3 instantiations of CommandViewModel
Aspire.Dashboard (1)
ServiceClient\Partials.cs (1)
120.Select(c => new CommandViewModel(c.Name, MapState(c.State), c.DisplayName, c.DisplayDescription, c.ConfirmationMessage, c.Parameter, c.IsHighlighted, c.IconName, MapIconVariant(c.IconVariant)))
Aspire.Dashboard.Components.Tests (2)
Pages\ConsoleLogsTests.cs (2)
593commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", parameter: null, isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]); 657commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", parameter: null, isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]);
46 references to CommandViewModel
Aspire.Dashboard (35)
Components\Controls\ResourceActions.razor.cs (3)
36public required EventCallback<CommandViewModel> CommandSelected { get; set; } 39public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 56private readonly List<CommandViewModel> _highlightedCommands = new();
Components\Controls\ResourceDetails.razor.cs (2)
38public required EventCallback<CommandViewModel> CommandSelected { get; set; } 41public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; }
Components\Pages\ConsoleLogs.razor.cs (3)
166private readonly List<CommandViewModel> _highlightedCommands = new(); 514EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 554private async Task ExecuteResourceCommandAsync(CommandViewModel command)
Components\Pages\Resources.razor.cs (3)
566foreach (var command in resource.Commands) 648EventCallback.Factory.Create<CommandViewModel>(this, (command) => ExecuteResourceCommandAsync(resource, command)), 765private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components_Controls_ResourceActions_razor.g.cs (1)
228var highlightedCommand = _highlightedCommands[i];
Components_Pages_ConsoleLogs_razor.g.cs (1)
543foreach (var command in _highlightedCommands)
Components_Pages_Resources_razor.g.cs (6)
2679), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Model.CommandViewModel>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Model.CommandViewModel>(this, 2696), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.CommandViewModel, global::System.Boolean>)( 3339), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Model.CommandViewModel>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Model.CommandViewModel>(this, 3356), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.CommandViewModel, global::System.Boolean>)(
Mcp\AspireResourceMcpTools.cs (1)
155var command = resource.Commands.FirstOrDefault(c => string.Equals(c.Name, commandName, StringComparisons.CommandName));
Model\DashboardCommandExecutor.cs (2)
33public async Task ExecuteAsync(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 85public async Task ExecuteAsyncCore(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName)
Model\ResourceMenuBuilder.cs (8)
78EventCallback<CommandViewModel> commandSelected, 79Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting, 285private void AddCommandMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, EventCallback<CommandViewModel> commandSelected, Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting) 302foreach (var highlightedCommand in highlightedMenuCommands) 313foreach (var command in otherMenuCommands) 328foreach (var command in otherMenuCommands) 334MenuButtonItem CreateMenuItem(CommandViewModel command)
Model\ResourceViewModel.cs (1)
40public required ImmutableArray<CommandViewModel> Commands { get; init; }
ServiceClient\DashboardClient.cs (1)
744public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (1)
73Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken);
ServiceClient\Partials.cs (1)
117ImmutableArray<CommandViewModel> GetCommands()
Telemetry\TelemetryPropertyValues.cs (1)
15return CommandViewModel.IsKnownCommand(commandName)
Aspire.Dashboard.Components.Tests (2)
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (1)
52public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken)
Aspire.Dashboard.Tests (9)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (1)
43public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken) => throw new NotImplementedException();
Mcp\AspireResourceMcpToolsTests.cs (2)
190commands: ImmutableArray<CommandViewModel>.Empty, 206var resource = ModelTestHelpers.CreateResource(resourceName: "app1", commands: ImmutableArray<CommandViewModel>.Empty);
Model\ResourceMenuBuilderTests.cs (3)
67EventCallback<CommandViewModel>.Empty, 118EventCallback<CommandViewModel>.Empty, 169EventCallback<CommandViewModel>.Empty,
ResourceOutgoingPeerResolverTests.cs (1)
418public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (1)
52public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken)