csharpdeeb25a2 | 1 | using CascadeIDE.Contracts; |
| 2 | using CascadeIDE.Models; |
| 3 | using CascadeIDE.Services; |
| 4 | |
| 5 | namespace CascadeIDE.Features.Build.Application; |
| 6 | |
| 7 | /// <summary>Подготовка UI-сессии локальной сборки решения из главного окна.</summary> |
| 8 | [PresentationProjection("main window build solution ui prep")] |
| 9 | public static class MainWindowBuildSolutionPrepProjection |
| 10 | { |
| 11 | public sealed record Prep(string SolutionPath, string BuildOutputHeader, MfdShellPage TargetMfdPage); |
| 12 | |
| 13 | public static bool CanBuild(string? solutionPath, bool isBuilding) => |
| 14 | IdeMcpSolutionPathAvailability.IsRunnableSolutionFile(solutionPath) && !isBuilding; |
| 15 | |
| 16 | public static Prep? TryCreatePrep(string? solutionPath) |
| 17 | { |
| 18 | if (!IdeMcpSolutionPathAvailability.IsRunnableSolutionFile(solutionPath)) |
| 19 | return null; |
| 20 | |
| 21 | return new Prep( |
| 22 | solutionPath!, |
| 23 | $"Сборка: {solutionPath}\r\n", |
| 24 | MfdShellPage.Build); |
| 25 | } |
| 26 | } |
| 27 | |
View only · write via MCP/CIDE