15 instantiations of CommandViewModel
Aspire.Dashboard (1)
ServiceClient\Partials.cs (1)
122
.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 (7)
Controls\ResourceDetailsTests.cs (3)
731
var setCommand = new
CommandViewModel
(
777
var setCommand = new
CommandViewModel
(
823
var setCommand = 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)
157
new
CommandViewModel
(
Aspire.Dashboard.Tests (7)
Model\DashboardClientTests.cs (1)
832
return new
CommandViewModel
(
Model\DashboardCommandExecutorTests.cs (1)
240
return new
CommandViewModel
(
Model\ResourceMenuBuilderTests.cs (5)
288
var startCommand = new
CommandViewModel
(
298
var stopCommand = new
CommandViewModel
(
335
var command = new
CommandViewModel
(
379
var command = new
CommandViewModel
(
421
var command = new
CommandViewModel
(
82 references to CommandViewModel
Aspire.Dashboard (31)
Components\Controls\ResourceActions.razor.cs (3)
39
public required EventCallback<
CommandViewModel
> CommandSelected { get; set; }
42
public required Func<ResourceViewModel,
CommandViewModel
, bool> IsCommandExecuting { get; set; }
59
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; }
225
["OnExecuteCommandAsync"] = (Func<ResourceViewModel,
CommandViewModel
, Task>)ExecuteResourceCommandAsync,
314
private async Task ExecuteResourceCommandAsync(ResourceViewModel resource,
CommandViewModel
command)
Components\Pages\ConsoleLogs.razor.cs (3)
190
private readonly List<
CommandViewModel
> _highlightedCommands = new();
796
EventCallback.Factory.Create<
CommandViewModel
>(this, ExecuteResourceCommandAsync),
836
private async Task ExecuteResourceCommandAsync(
CommandViewModel
command)
Components\Pages\Resources.razor.cs (3)
564
foreach (
var
command in resource.Commands)
658
EventCallback.Factory.Create<
CommandViewModel
>(this, (command) => ExecuteResourceCommandAsync(resource, command)),
766
private async Task ExecuteResourceCommandAsync(ResourceViewModel resource,
CommandViewModel
command)
Model\DashboardCommandExecutor.cs (4)
36
public async Task ExecuteAsync(ResourceViewModel resource,
CommandViewModel
command, Func<ResourceViewModel, string> getResourceName)
88
public async Task ExecuteAsyncCore(ResourceViewModel resource,
CommandViewModel
command, Func<ResourceViewModel, string> getResourceName)
337
private static NotificationAction CreateViewResponseNotificationAction(IStringLocalizer<Dashboard.Resources.Resources> loc,
CommandViewModel
command, ResourceCommandResponseViewModel response)
352
private static async Task OpenViewResponseDialogAsync(DashboardDialogService dialogService,
CommandViewModel
command, ResourceCommandResponseViewModel response)
Model\ResourceMenuBuilder.cs (8)
67
EventCallback<
CommandViewModel
> commandSelected,
68
Func<ResourceViewModel,
CommandViewModel
, bool> isCommandExecuting,
257
private void AddCommandMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, EventCallback<
CommandViewModel
> commandSelected, Func<ResourceViewModel,
CommandViewModel
, bool> isCommandExecuting)
274
foreach (
var
highlightedCommand in highlightedMenuCommands)
285
foreach (
var
command in otherMenuCommands)
300
foreach (
var
command in otherMenuCommands)
306
MenuButtonItem CreateMenuItem(
CommandViewModel
command)
Model\ResourceViewModel.cs (1)
42
public required ImmutableArray<
CommandViewModel
> Commands { get; init; }
ServiceClient\DashboardClient.cs (1)
1033
public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (1)
65
Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken);
ServiceClient\Partials.cs (1)
119
ImmutableArray<
CommandViewModel
> GetCommands()
ServiceClient\SelectedDashboardClient.cs (1)
61
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 (20)
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)
Pages\ResourcesTests.cs (2)
178
builder.Add(component => component.CommandSelected, EventCallback.Factory.Create<
CommandViewModel
>(this, _ => Task.CompletedTask));
179
builder.Add(component => component.IsCommandExecuting, (ResourceViewModel _,
CommandViewModel
_) => false);
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24
ImmutableArray<
CommandViewModel
>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
22
private readonly Func<string, string,
CommandViewModel
, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
43
Func<string, string,
CommandViewModel
, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
73
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Aspire.Dashboard.Tests (31)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (1)
51
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Model\DashboardClientTests.cs (1)
830
private static
CommandViewModel
CreateCommand()
Model\DashboardCommandExecutorTests.cs (5)
40
var
command = CreateCommand();
84
var
command = CreateCommand();
124
var
command = CreateCommand();
168
var
command = CreateCommand();
238
private static
CommandViewModel
CreateCommand()
Model\ResourceMenuBuilderTests.cs (17)
99
EventCallback<
CommandViewModel
>.Empty,
150
EventCallback<
CommandViewModel
>.Empty,
201
EventCallback<
CommandViewModel
>.Empty,
238
EventCallback<
CommandViewModel
>.Empty,
272
EventCallback<
CommandViewModel
>.Empty,
288
var
startCommand = new CommandViewModel(
289
CommandViewModel
.StartCommand,
298
var
stopCommand = new CommandViewModel(
299
CommandViewModel
.StopCommand,
319
EventCallback<
CommandViewModel
>.Empty,
335
var
command = new CommandViewModel(
336
CommandViewModel
.StartCommand,
358
EventCallback<
CommandViewModel
>.Empty,
379
var
command = new CommandViewModel(
400
EventCallback<
CommandViewModel
>.Empty,
421
var
command = new CommandViewModel(
442
EventCallback<
CommandViewModel
>.Empty,
Model\SqliteResourceRepositoryTests.cs (1)
442
var
command = Assert.Single(actual.Commands);
ResourceOutgoingPeerResolverTests.cs (1)
695
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Terminal\DefaultTerminalConnectionResolverTests.cs (1)
152
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)
22
private readonly Func<string, string,
CommandViewModel
, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
43
Func<string, string,
CommandViewModel
, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
73
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)