49 references to ResourceCommandState
Aspire.Hosting (19)
ApplicationModel\CommandsConfigurationExtensions.cs (8)
37
return
ResourceCommandState
.Disabled;
41
return
ResourceCommandState
.Enabled;
45
return
ResourceCommandState
.Hidden;
70
return
ResourceCommandState
.Disabled;
74
return
ResourceCommandState
.Enabled;
78
return
ResourceCommandState
.Hidden;
104
return
ResourceCommandState
.Disabled;
108
return
ResourceCommandState
.Enabled;
ApplicationModel\CustomResourceSnapshot.cs (1)
246
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)
530
var
newState = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = _serviceProvider });
573
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)
1036
Func<UpdateCommandStateContext,
ResourceCommandState
>? updateState = null,
1056
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)
12
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Starting",
ResourceCommandState
.Disabled)]
13
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Stopping",
ResourceCommandState
.Hidden)]
14
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Running",
ResourceCommandState
.Hidden)]
15
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Exited",
ResourceCommandState
.Enabled)]
16
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Finished",
ResourceCommandState
.Enabled)]
17
[InlineData(CommandsConfigurationExtensions.StartCommandName, "FailedToStart",
ResourceCommandState
.Enabled)]
18
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Unknown",
ResourceCommandState
.Enabled)]
19
[InlineData(CommandsConfigurationExtensions.StartCommandName, "Waiting",
ResourceCommandState
.Enabled)]
20
[InlineData(CommandsConfigurationExtensions.StartCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
21
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Starting",
ResourceCommandState
.Hidden)]
22
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Stopping",
ResourceCommandState
.Disabled)]
23
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Running",
ResourceCommandState
.Enabled)]
24
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Exited",
ResourceCommandState
.Hidden)]
25
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Finished",
ResourceCommandState
.Hidden)]
26
[InlineData(CommandsConfigurationExtensions.StopCommandName, "FailedToStart",
ResourceCommandState
.Hidden)]
27
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Unknown",
ResourceCommandState
.Hidden)]
28
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Waiting",
ResourceCommandState
.Hidden)]
29
[InlineData(CommandsConfigurationExtensions.StopCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Hidden)]
30
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Starting",
ResourceCommandState
.Disabled)]
31
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Stopping",
ResourceCommandState
.Disabled)]
32
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Running",
ResourceCommandState
.Enabled)]
33
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Exited",
ResourceCommandState
.Disabled)]
34
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Finished",
ResourceCommandState
.Disabled)]
35
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "FailedToStart",
ResourceCommandState
.Disabled)]
36
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Unknown",
ResourceCommandState
.Disabled)]
37
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Waiting",
ResourceCommandState
.Disabled)]
38
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
39
public void LifeCycleCommands_CommandState(string commandName, string resourceState,
ResourceCommandState
commandState)
49
var
state = startCommand.UpdateState(new UpdateCommandStateContext