csharpdeeb25a2 | 1 | using CascadeIDE.Contracts; |
| 2 | using CascadeIDE.Models; |
| 3 | |
| 4 | namespace CascadeIDE.Features.Workspace.Application; |
| 5 | |
| 6 | /// <summary>Решения после успешной загрузки дерева решения (первая страница MFD и нормализованный путь).</summary> |
| 7 | [PresentationProjection("solution load ui apply")] |
| 8 | public static class SolutionLoadUiApplyProjection |
| 9 | { |
| 10 | public sealed record Plan(string NormalizedSolutionPath, MfdShellPage InitialMfdPage); |
| 11 | |
| 12 | public static Plan Create( |
| 13 | string originalPath, |
| 14 | string? normalizedSolutionPath, |
| 15 | bool isDockedMfdSolutionExplorerTree, |
| 16 | PresentationTierKind presentationTier) => |
| 17 | new( |
| 18 | normalizedSolutionPath ?? originalPath, |
| 19 | ResolveInitialMfdPage(isDockedMfdSolutionExplorerTree, presentationTier)); |
| 20 | |
| 21 | private static MfdShellPage ResolveInitialMfdPage( |
| 22 | bool isDockedMfdSolutionExplorerTree, |
| 23 | PresentationTierKind presentationTier) |
| 24 | { |
| 25 | if (presentationTier == PresentationTierKind.Compact) |
| 26 | return MfdShellPage.Chat; |
| 27 | |
| 28 | return isDockedMfdSolutionExplorerTree |
| 29 | ? MfdShellPage.SolutionExplorer |
| 30 | : MfdShellPage.Terminal; |
| 31 | } |
| 32 | } |
| 33 | |
View only · write via MCP/CIDE