16 instantiations of CommandViewModel
Aspire.Dashboard (1)
ServiceClient\Partials.cs (1)
134.Select(c => new CommandViewModel(c.Name, MapState(c.State), c.DisplayName, c.DisplayDescription, c.ConfirmationMessage, c.ArgumentInputs.ToImmutableArray(), c.IsHighlighted, c.IconName, MapIconVariant(c.IconVariant)))
Aspire.Dashboard.Components.Tests (8)
Controls\ResourceDetailsTests.cs (3)
731var setCommand = new CommandViewModel( 777var setCommand = new CommandViewModel( 823var setCommand = new CommandViewModel(
Model\DashboardCommandExecutorTests.cs (1)
79var command = new CommandViewModel(
Pages\ConsoleLogsTests.cs (3)
793commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]); 858new CommandViewModel( 902commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]);
Pages\ResourcesTests.cs (1)
218new CommandViewModel(
Aspire.Dashboard.Tests (7)
Model\DashboardClientTests.cs (1)
1509return new CommandViewModel(
Model\DashboardCommandExecutorTests.cs (1)
307return new CommandViewModel(
Model\ResourceMenuBuilderTests.cs (5)
330var startCommand = new CommandViewModel( 340var stopCommand = new CommandViewModel( 378var command = new CommandViewModel( 423var command = new CommandViewModel( 466var command = new CommandViewModel(
89 references to CommandViewModel
Aspire.Dashboard (34)
Components\Controls\ResourceActions.razor.cs (3)
29public required EventCallback<CommandViewModel> CommandSelected { get; set; } 32public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 49private readonly List<CommandViewModel> _highlightedCommands = new();
Components\Controls\ResourceDetails.razor.cs (4)
38public required EventCallback<CommandViewModel> CommandSelected { get; set; } 41public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 218["OnExecuteCommandAsync"] = (Func<ResourceViewModel, CommandViewModel, Task>)ExecuteResourceCommandAsync, 308private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components\Pages\ConsoleLogs.razor.cs (3)
165private readonly List<CommandViewModel> _highlightedCommands = new(); 582EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 623private async Task ExecuteResourceCommandAsync(CommandViewModel command)
Components\Pages\Resources.razor.cs (3)
621foreach (var command in resource.Commands) 715EventCallback.Factory.Create<CommandViewModel>(this, (command) => ExecuteResourceCommandAsync(resource, command)), 830private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components\Pages\Terminals.razor.cs (3)
24private readonly List<CommandViewModel> _highlightedCommands = []; 264EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 270private Task ExecuteResourceCommandAsync(CommandViewModel command)
Model\DashboardCommandExecutor.cs (4)
40public async Task ExecuteAsync(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 87public async Task ExecuteAsyncCore(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 339private static NotificationAction CreateViewResponseNotificationAction(IStringLocalizer<Dashboard.Resources.Resources> loc, CommandViewModel command, ResourceCommandResponseViewModel response) 354private static async Task OpenViewResponseDialogAsync(DashboardDialogService dialogService, CommandViewModel command, ResourceCommandResponseViewModel response)
Model\ResourceMenuBuilder.cs (8)
71EventCallback<CommandViewModel> commandSelected, 72Func<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)
42public required ImmutableArray<CommandViewModel> Commands { get; init; }
ServiceClient\DashboardClient.cs (1)
1090public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (1)
75Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken);
ServiceClient\Partials.cs (1)
131ImmutableArray<CommandViewModel> GetCommands()
ServiceClient\SelectedDashboardClient.cs (1)
66public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Telemetry\TelemetryPropertyValues.cs (1)
15return CommandViewModel.IsKnownCommand(commandName)
Aspire.Dashboard.Components.Tests (22)
Controls\ResourceActionsTests.cs (1)
142.Add(component => component.CommandSelected, EventCallback<CommandViewModel>.Empty)
Controls\ResourceDetailsTests.cs (14)
731var setCommand = new CommandViewModel( 732CommandViewModel.SetParameterCommand, 754CommandViewModel? capturedCommand = null; 759builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 769Assert.Equal(CommandViewModel.SetParameterCommand, capturedCommand!.Name); 777var setCommand = new CommandViewModel( 778CommandViewModel.SetParameterCommand, 800CommandViewModel? capturedCommand = null; 805builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 807currentResource.Name == resource.Name && command.Name == CommandViewModel.SetParameterCommand); 823var setCommand = new CommandViewModel( 824CommandViewModel.SetParameterCommand, 850builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask)); 917ImmutableArray<CommandViewModel>? commands = null)
Model\DashboardCommandExecutorTests.cs (1)
79var command = new CommandViewModel(
Pages\ResourcesTests.cs (2)
239builder.Add(component => component.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask)); 240builder.Add(component => component.IsCommandExecuting, (ResourceViewModel _, CommandViewModel _) => false);
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand; 63Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null, 101public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Aspire.Dashboard.Tests (33)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (1)
54public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Model\DashboardClientTests.cs (1)
1507private static CommandViewModel CreateCommand()
Model\DashboardCommandExecutorTests.cs (6)
49var command = CreateCommand(); 101var command = CreateCommand(); 145var command = CreateCommand(); 185var command = CreateCommand(); 229var command = CreateCommand(); 305private static CommandViewModel CreateCommand()
Model\ResourceMenuBuilderTests.cs (18)
100EventCallback<CommandViewModel>.Empty, 152EventCallback<CommandViewModel>.Empty, 187EventCallback<CommandViewModel>.Empty, 240EventCallback<CommandViewModel>.Empty, 278EventCallback<CommandViewModel>.Empty, 313EventCallback<CommandViewModel>.Empty, 330var startCommand = new CommandViewModel( 331CommandViewModel.StartCommand, 340var stopCommand = new CommandViewModel( 341CommandViewModel.StopCommand, 361EventCallback<CommandViewModel>.Empty, 378var command = new CommandViewModel( 379CommandViewModel.StartCommand, 401EventCallback<CommandViewModel>.Empty, 423var command = new CommandViewModel( 444EventCallback<CommandViewModel>.Empty, 466var command = new CommandViewModel( 487EventCallback<CommandViewModel>.Empty,
Model\SqliteResourceRepositoryTests.cs (1)
482var command = Assert.Single(actual.Commands);
ResourceOutgoingPeerResolverTests.cs (1)
696public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Terminal\DefaultTerminalConnectionResolverTests.cs (1)
196public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand; 63Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null, 101public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)