| 1 | using static CascadeIDE.Services.IdeCommands; |
| 2 | |
| 3 | namespace CascadeIDE.Features.IdeMcp.Execution; |
| 4 | |
| 5 | /// <summary>MCP-хендлеры показа панелей MFD, групп редакторов и сборки из UI.</summary> |
| 6 | internal sealed partial class IdeMcpCommandExecutor |
| 7 | { |
| 8 | private void RegisterMenuToolbarPanelsLayoutAndBuild(Action<string, Handler> add) |
| 9 | { |
| 10 | add(ShowPfdRegionPanel, async (_, _) => |
| 11 | { |
| 12 | if (_vm.ShowPfdRegionPanelCommand.CanExecute(null)) |
| 13 | _vm.ShowPfdRegionPanelCommand.Execute(null); |
| 14 | return "OK"; |
| 15 | }); |
| 16 | add(ShowBuildOutputPanel, async (_, _) => |
| 17 | { |
| 18 | if (_vm.ShowBuildOutputPanelCommand.CanExecute(null)) |
| 19 | _vm.ShowBuildOutputPanelCommand.Execute(null); |
| 20 | return "OK"; |
| 21 | }); |
| 22 | add(ShowChatPage, async (_, _) => |
| 23 | { |
| 24 | if (_vm.ShowChatPageCommand.CanExecute(null)) |
| 25 | _vm.ShowChatPageCommand.Execute(null); |
| 26 | return "OK"; |
| 27 | }); |
| 28 | add(ShowSolutionExplorerPage, async (_, _) => |
| 29 | { |
| 30 | if (_vm.ShowSolutionExplorerPageCommand.CanExecute(null)) |
| 31 | _vm.ShowSolutionExplorerPageCommand.Execute(null); |
| 32 | return "OK"; |
| 33 | }); |
| 34 | add(ShowRelatedFilesMfdPage, async (_, _) => |
| 35 | { |
| 36 | if (_vm.ShowRelatedFilesMfdPageCommand.CanExecute(null)) |
| 37 | _vm.ShowRelatedFilesMfdPageCommand.Execute(null); |
| 38 | return "OK"; |
| 39 | }); |
| 40 | add(ShowTerminalPanel, async (_, _) => |
| 41 | { |
| 42 | if (_vm.ShowTerminalPanelCommand.CanExecute(null)) |
| 43 | _vm.ShowTerminalPanelCommand.Execute(null); |
| 44 | return "OK"; |
| 45 | }); |
| 46 | add(HideBuildOutputPanel, async (_, _) => |
| 47 | { |
| 48 | if (_vm.HideBuildOutputCommand.CanExecute(null)) |
| 49 | _vm.HideBuildOutputCommand.Execute(null); |
| 50 | return "OK"; |
| 51 | }); |
| 52 | |
| 53 | add(SetSingleEditorGroup, async (_, _) => |
| 54 | { |
| 55 | if (_vm.SetSingleEditorGroupCommand.CanExecute(null)) |
| 56 | _vm.SetSingleEditorGroupCommand.Execute(null); |
| 57 | return "OK"; |
| 58 | }); |
| 59 | add(SetDualEditorGroup, async (_, _) => |
| 60 | { |
| 61 | if (_vm.SetDualEditorGroupCommand.CanExecute(null)) |
| 62 | _vm.SetDualEditorGroupCommand.Execute(null); |
| 63 | return "OK"; |
| 64 | }); |
| 65 | add(SetTripleEditorGroup, async (_, _) => |
| 66 | { |
| 67 | if (_vm.SetTripleEditorGroupCommand.CanExecute(null)) |
| 68 | _vm.SetTripleEditorGroupCommand.Execute(null); |
| 69 | return "OK"; |
| 70 | }); |
| 71 | |
| 72 | add(BuildSolutionUi, async (_, _) => |
| 73 | { |
| 74 | if (_vm.BuildSolutionCommand.CanExecute(null)) |
| 75 | await _vm.BuildSolutionCommand.ExecuteAsync(null); |
| 76 | return "OK"; |
| 77 | }); |
| 78 | } |
| 79 | } |
| 80 | |