Forge
csharpdeeb25a2
1using System.Collections.Frozen;
2using CascadeIDE.ViewModels;
3
4namespace CascadeIDE.Features.Shell;
5
6/// <summary>
7/// Presentation-зависимости на <see cref="MainWindowViewModel"/> при смене shell-свойств (бывшие <c>NotifyPropertyChangedFor</c> на MWVM).
8/// </summary>
9internal static class ShellChromePresentationNotifyMap
10{
11 private static readonly FrozenDictionary<string, string[]> Map = CreateMap();
12
13 public static ReadOnlySpan<string> GetDependents(string shellPropertyName) =>
14 Map.TryGetValue(shellPropertyName, out var names) ? names : ReadOnlySpan<string>.Empty;
15
16 private static FrozenDictionary<string, string[]> CreateMap()
17 {
18 return new Dictionary<string, string[]>(StringComparer.Ordinal)
19 {
20 [nameof(ShellChromeViewModel.IsMfdRegionExpanded)] =
21 [
22 nameof(MainWindowViewModel.MfdRegionToggleButtonText),
23 nameof(MainWindowViewModel.MfdRegionPixelWidth),
24 nameof(MainWindowViewModel.IsMfdRegionVisible),
25 nameof(MainWindowViewModel.IsMfdColumnVisible),
26 nameof(MainWindowViewModel.IsCockpitMfdColumnVisible),
27 nameof(MainWindowViewModel.IsCompactRightChromeColumnVisible),
28 nameof(MainWindowViewModel.IsCompactIntercomAuxVisible),
29 nameof(MainWindowViewModel.IsCompactIntercomBottomDockVisible),
30 nameof(MainWindowViewModel.CompactRightChromeColumnPixelWidth),
31 nameof(MainWindowViewModel.CompactIntercomBottomDockHeightPixels),
32 nameof(MainWindowViewModel.CompactMfdBottomDockGridRow),
33 nameof(MainWindowViewModel.CompactMfdBottomDockSplitterGridRow),
34 nameof(MainWindowViewModel.IsSkiaZoneGeometryOverlayMfdVisible),
35 nameof(MainWindowViewModel.IsPfdIdeHealthMountVisible),
36 nameof(MainWindowViewModel.IsMfdIdeHealthMountVisible),
37 nameof(MainWindowViewModel.PfdIdeHealthMountContext),
38 nameof(MainWindowViewModel.MfdIdeHealthMountContext),
39 nameof(MainWindowViewModel.IsMfdRegionCollapsed),
40 nameof(MainWindowViewModel.IsChatPanelHidden),
41 nameof(MainWindowViewModel.ChatPanelColumnPixelWidth),
42 nameof(MainWindowViewModel.IsChatPanelColumnVisible),
43 nameof(MainWindowViewModel.MainGridColumnDefinitions),
44 ],
45 [nameof(ShellChromeViewModel.IsPfdRegionExpanded)] =
46 [
47 nameof(MainWindowViewModel.IsPfdColumnVisible),
48 nameof(MainWindowViewModel.IsCompactPfdRightVisible),
49 nameof(MainWindowViewModel.IsCompactRightChromeColumnVisible),
50 nameof(MainWindowViewModel.CompactRightChromeColumnPixelWidth),
51 nameof(MainWindowViewModel.IsSkiaZoneGeometryOverlayPfdVisible),
52 nameof(MainWindowViewModel.IsPfdIdeHealthMountVisible),
53 nameof(MainWindowViewModel.PfdIdeHealthMountContext),
54 nameof(MainWindowViewModel.IsPfdRegionCollapsed),
55 nameof(MainWindowViewModel.IsSolutionPanelHidden),
56 nameof(MainWindowViewModel.MainGridColumnDefinitions),
57 ],
58 [nameof(ShellChromeViewModel.IsTerminalVisible)] =
59 [
60 nameof(MainWindowViewModel.ShowTelemetryHiddenHint),
61 nameof(MainWindowViewModel.TelemetryButtonText),
62 nameof(MainWindowViewModel.IsMfdContourContentVisible),
63 nameof(MainWindowViewModel.ShowWorkspaceBottomChrome),
64 nameof(MainWindowViewModel.IsTerminalPanelHidden),
65 nameof(MainWindowViewModel.IsCompactMfdBottomDockVisible),
66 nameof(MainWindowViewModel.MainGridRowDefinitions),
67 nameof(MainWindowViewModel.CompactMfdBottomDockHeightPixels),
68 nameof(MainWindowViewModel.CompactMfdBottomDockGridRow),
69 nameof(MainWindowViewModel.CompactMfdBottomDockSplitterGridRow),
70 ],
71 [nameof(ShellChromeViewModel.IsGitPanelVisible)] =
72 [
73 nameof(MainWindowViewModel.IsMfdContourContentVisible),
74 nameof(MainWindowViewModel.ShowWorkspaceBottomChrome),
75 nameof(MainWindowViewModel.IsCompactMfdBottomDockVisible),
76 nameof(MainWindowViewModel.MainGridRowDefinitions),
77 nameof(MainWindowViewModel.CompactMfdBottomDockGridRow),
78 nameof(MainWindowViewModel.CompactMfdBottomDockSplitterGridRow),
79 ],
80 [nameof(ShellChromeViewModel.IsBuildOutputVisible)] =
81 [
82 nameof(MainWindowViewModel.IsMfdContourContentVisible),
83 nameof(MainWindowViewModel.ShowWorkspaceBottomChrome),
84 nameof(MainWindowViewModel.IsBuildPanelHidden),
85 nameof(MainWindowViewModel.IsCompactMfdBottomDockVisible),
86 nameof(MainWindowViewModel.MainGridRowDefinitions),
87 nameof(MainWindowViewModel.CompactMfdBottomDockGridRow),
88 nameof(MainWindowViewModel.CompactMfdBottomDockSplitterGridRow),
89 ],
90 [nameof(ShellChromeViewModel.IsInstrumentationDockVisible)] =
91 [
92 nameof(MainWindowViewModel.InstrumentationTabs),
93 nameof(MainWindowViewModel.HypothesesTab),
94 nameof(MainWindowViewModel.IsMfdContourContentVisible),
95 nameof(MainWindowViewModel.ShowWorkspaceBottomChrome),
96 nameof(MainWindowViewModel.IsCompactMfdBottomDockVisible),
97 nameof(MainWindowViewModel.MainGridRowDefinitions),
98 nameof(MainWindowViewModel.CompactMfdBottomDockGridRow),
99 nameof(MainWindowViewModel.CompactMfdBottomDockSplitterGridRow),
100 ],
101 [nameof(ShellChromeViewModel.CurrentMfdShellPage)] =
102 [
103 nameof(MainWindowViewModel.IsMfdShellSolutionExplorerPageActive),
104 nameof(MainWindowViewModel.CurrentMfdShellPageAsShell),
105 nameof(MainWindowViewModel.ChatPanelColumnPixelWidth),
106 nameof(MainWindowViewModel.IsChatPanelColumnVisible),
107 nameof(MainWindowViewModel.IsMfdColumnVisible),
108 nameof(MainWindowViewModel.MfdRegionPixelWidth),
109 nameof(MainWindowViewModel.IsMfdRegionVisible),
110 nameof(MainWindowViewModel.MainGridColumnDefinitions),
111 ],
112 [nameof(ShellChromeViewModel.UiMode)] =
113 [
114 nameof(MainWindowViewModel.UiModeFamily),
115 nameof(MainWindowViewModel.MfdRegionPixelWidth),
116 nameof(MainWindowViewModel.IsMfdRegionVisible),
117 nameof(MainWindowViewModel.IsMfdColumnVisible),
118 nameof(MainWindowViewModel.IsSkiaZoneGeometryOverlayPfdVisible),
119 nameof(MainWindowViewModel.IsSkiaZoneGeometryOverlayForwardVisible),
120 nameof(MainWindowViewModel.IsSkiaZoneGeometryOverlayMfdVisible),
121 nameof(MainWindowViewModel.UseSkiaInstrumentMount),
122 nameof(MainWindowViewModel.IsPfdIdeHealthMountVisible),
123 nameof(MainWindowViewModel.IsMfdIdeHealthMountVisible),
124 nameof(MainWindowViewModel.IsMfdHostWindowIdeHealthMountVisible),
125 nameof(MainWindowViewModel.PfdIdeHealthMountContext),
126 nameof(MainWindowViewModel.MfdIdeHealthMountContext),
127 nameof(MainWindowViewModel.ShowTaskBar),
128 nameof(MainWindowViewModel.ShowIdeHealthStrip),
129 nameof(MainWindowViewModel.ShowIdeHealthMfdPage),
130 nameof(MainWindowViewModel.ShowEicasAlertsBar),
131 nameof(MainWindowViewModel.ShowWorkspaceChromeBand),
132 nameof(MainWindowViewModel.IdeHealthStripSurface),
133 nameof(MainWindowViewModel.IdeHealthContentRepresentation),
134 nameof(MainWindowViewModel.ShowWorkspaceBottomChrome),
135 nameof(MainWindowViewModel.QuickActions),
136 nameof(MainWindowViewModel.ShowAgentOperations),
137 nameof(MainWindowViewModel.AgentTrace),
138 nameof(MainWindowViewModel.AutonomousAgentTelemetry),
139 nameof(MainWindowViewModel.IdeHealthOnTerminalTab),
140 nameof(MainWindowViewModel.ShowSafetyControls),
141 nameof(MainWindowViewModel.ShowTelemetryHiddenHint),
142 nameof(MainWindowViewModel.TelemetryButtonText),
143 nameof(MainWindowViewModel.ShowEditorGroup2),
144 nameof(MainWindowViewModel.ShowEditorGroup3),
145 nameof(MainWindowViewModel.IsRiskCardVisible),
146 nameof(MainWindowViewModel.IsResultCardVisible),
147 nameof(MainWindowViewModel.AgentOperationsPanel),
148 nameof(MainWindowViewModel.InstrumentationTabs),
149 nameof(MainWindowViewModel.HypothesesTab),
150 nameof(MainWindowViewModel.ShowInstrumentationLayoutMenu),
151 nameof(MainWindowViewModel.IsMfdContourContentVisible),
152 nameof(MainWindowViewModel.IsProblemsPanelVisible),
153 nameof(MainWindowViewModel.WindowTitle),
154 ],
155 [nameof(ShellChromeViewModel.EditorGroupCount)] =
156 [
157 nameof(MainWindowViewModel.ShowEditorGroup2),
158 nameof(MainWindowViewModel.ShowEditorGroup3),
159 ],
160 [nameof(ShellChromeViewModel.IsBuilding)] =
161 [
162 nameof(MainWindowViewModel.IdeHealthBuildText),
163 nameof(MainWindowViewModel.IdeHealthBuildCockpitShort),
164 nameof(MainWindowViewModel.IdeHealthMountPayload),
165 nameof(MainWindowViewModel.PfdIdeHealthMountContext),
166 nameof(MainWindowViewModel.MfdIdeHealthMountContext),
167 ],
168 }.ToFrozenDictionary(StringComparer.Ordinal);
169 }
170}
171
View only · write via MCP/CIDE