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