csharpdeeb25a2 | 1 | using CascadeIDE.Cockpit.Composition.HostSurface; |
| 2 | |
| 3 | namespace CascadeIDE.Cockpit.Surface; |
| 4 | |
| 5 | /// <summary> |
| 6 | /// Реестр монтирования инструментов главного окна: связывает стабильный <c>instrument_id</c> |
| 7 | /// с конкретным видом рендера на стороне хоста (Avalonia/Skia), не затрагивая композитор. |
| 8 | /// </summary> |
| 9 | public static class MainWindowInstrumentMountRegistry |
| 10 | { |
| 11 | private static readonly IReadOnlyDictionary<string, CockpitInstrumentMount> Items = |
| 12 | new Dictionary<string, CockpitInstrumentMount>(StringComparer.Ordinal) |
| 13 | { |
| 14 | [CockpitStandardInstrumentIds.SolutionExplorerTree] = new( |
| 15 | CockpitStandardInstrumentIds.SolutionExplorerTree, |
| 16 | CockpitInstrumentMountKind.AvaloniaView, |
| 17 | "solution_explorer"), |
| 18 | }; |
| 19 | |
| 20 | public static bool TryResolve(string instrumentId, out CockpitInstrumentMount mount) => |
| 21 | Items.TryGetValue(instrumentId, out mount); |
| 22 | } |
| 23 | |
| 24 | public enum CockpitInstrumentMountKind |
| 25 | { |
| 26 | AvaloniaView, |
| 27 | SkiaScene, |
| 28 | } |
| 29 | |
| 30 | public readonly record struct CockpitInstrumentMount( |
| 31 | string InstrumentId, |
| 32 | CockpitInstrumentMountKind MountKind, |
| 33 | string MountKey); |
| 34 | |
View only · write via MCP/CIDE