49 references to ResourceCommandState
Aspire.Hosting (19)
ApplicationModel\CommandsConfigurationExtensions.cs (8)
34
return
ResourceCommandState
.Disabled;
38
return
ResourceCommandState
.Enabled;
42
return
ResourceCommandState
.Hidden;
67
return
ResourceCommandState
.Disabled;
71
return
ResourceCommandState
.Enabled;
75
return
ResourceCommandState
.Hidden;
101
return
ResourceCommandState
.Disabled;
105
return
ResourceCommandState
.Enabled;
ApplicationModel\CustomResourceSnapshot.cs (1)
263
public sealed record ResourceCommandSnapshot(string Name,
ResourceCommandState
State, string DisplayName, string? DisplayDescription, object? Parameter, string? ConfirmationMessage, string? IconName, IconVariant? IconVariant, bool IsHighlighted);
ApplicationModel\ResourceCommandAnnotation.cs (2)
20
Func<UpdateCommandStateContext,
ResourceCommandState
> updateState,
60
public Func<UpdateCommandStateContext,
ResourceCommandState
> UpdateState { get; }
ApplicationModel\ResourceNotificationService.cs (2)
628
var
newState = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = _serviceProvider });
671
var
state = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = serviceProvider });
Dashboard\proto\Partials.cs (4)
115
private static ResourceCommandState MapCommandState(Hosting.ApplicationModel.
ResourceCommandState
state)
119
Hosting.ApplicationModel.
ResourceCommandState
.Enabled => ResourceCommandState.Enabled,
120
Hosting.ApplicationModel.
ResourceCommandState
.Disabled => ResourceCommandState.Disabled,
121
Hosting.ApplicationModel.
ResourceCommandState
.Hidden => ResourceCommandState.Hidden,
ResourceBuilderExtensions.cs (2)
1119
Func<UpdateCommandStateContext,
ResourceCommandState
>? updateState = null,
1139
return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, updateState ?? (c =>
ResourceCommandState
.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
Aspire.Hosting.Tests (30)
Dashboard\DashboardServiceTests.cs (1)
95
updateState: c => ApplicationModel.
ResourceCommandState
.Enabled,
ResourceCommandAnnotationTests.cs (29)
13
[InlineData(KnownResourceCommands.StartCommand, "Starting",
ResourceCommandState
.Disabled)]
14
[InlineData(KnownResourceCommands.StartCommand, "Stopping",
ResourceCommandState
.Hidden)]
15
[InlineData(KnownResourceCommands.StartCommand, "Running",
ResourceCommandState
.Hidden)]
16
[InlineData(KnownResourceCommands.StartCommand, "Exited",
ResourceCommandState
.Enabled)]
17
[InlineData(KnownResourceCommands.StartCommand, "Finished",
ResourceCommandState
.Enabled)]
18
[InlineData(KnownResourceCommands.StartCommand, "FailedToStart",
ResourceCommandState
.Enabled)]
19
[InlineData(KnownResourceCommands.StartCommand, "Unknown",
ResourceCommandState
.Enabled)]
20
[InlineData(KnownResourceCommands.StartCommand, "Waiting",
ResourceCommandState
.Enabled)]
21
[InlineData(KnownResourceCommands.StartCommand, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
22
[InlineData(KnownResourceCommands.StopCommand, "Starting",
ResourceCommandState
.Hidden)]
23
[InlineData(KnownResourceCommands.StopCommand, "Stopping",
ResourceCommandState
.Disabled)]
24
[InlineData(KnownResourceCommands.StopCommand, "Running",
ResourceCommandState
.Enabled)]
25
[InlineData(KnownResourceCommands.StopCommand, "Exited",
ResourceCommandState
.Hidden)]
26
[InlineData(KnownResourceCommands.StopCommand, "Finished",
ResourceCommandState
.Hidden)]
27
[InlineData(KnownResourceCommands.StopCommand, "FailedToStart",
ResourceCommandState
.Hidden)]
28
[InlineData(KnownResourceCommands.StopCommand, "Unknown",
ResourceCommandState
.Hidden)]
29
[InlineData(KnownResourceCommands.StopCommand, "Waiting",
ResourceCommandState
.Hidden)]
30
[InlineData(KnownResourceCommands.StopCommand, "RuntimeUnhealthy",
ResourceCommandState
.Hidden)]
31
[InlineData(KnownResourceCommands.RestartCommand, "Starting",
ResourceCommandState
.Disabled)]
32
[InlineData(KnownResourceCommands.RestartCommand, "Stopping",
ResourceCommandState
.Disabled)]
33
[InlineData(KnownResourceCommands.RestartCommand, "Running",
ResourceCommandState
.Enabled)]
34
[InlineData(KnownResourceCommands.RestartCommand, "Exited",
ResourceCommandState
.Disabled)]
35
[InlineData(KnownResourceCommands.RestartCommand, "Finished",
ResourceCommandState
.Disabled)]
36
[InlineData(KnownResourceCommands.RestartCommand, "FailedToStart",
ResourceCommandState
.Disabled)]
37
[InlineData(KnownResourceCommands.RestartCommand, "Unknown",
ResourceCommandState
.Disabled)]
38
[InlineData(KnownResourceCommands.RestartCommand, "Waiting",
ResourceCommandState
.Disabled)]
39
[InlineData(KnownResourceCommands.RestartCommand, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
40
public void LifeCycleCommands_CommandState(string commandName, string resourceState,
ResourceCommandState
commandState)
50
var
state = startCommand.UpdateState(new UpdateCommandStateContext