46 references to ResourceCommandState
Aspire.Hosting (19)
ApplicationModel\CommandsConfigurationExtensions.cs (8)
36
return
ResourceCommandState
.Disabled;
40
return
ResourceCommandState
.Enabled;
44
return
ResourceCommandState
.Hidden;
68
return
ResourceCommandState
.Disabled;
72
return
ResourceCommandState
.Enabled;
76
return
ResourceCommandState
.Hidden;
101
return
ResourceCommandState
.Disabled;
105
return
ResourceCommandState
.Enabled;
ApplicationModel\CustomResourceSnapshot.cs (1)
222
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)
416
var
newState = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = _serviceProvider });
459
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)
988
Func<UpdateCommandStateContext,
ResourceCommandState
>? updateState = null,
1008
return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, updateState ?? (c =>
ResourceCommandState
.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
Aspire.Hosting.Tests (27)
Dashboard\DashboardServiceTests.cs (1)
95
updateState: c => ApplicationModel.
ResourceCommandState
.Enabled,
ResourceCommandAnnotationTests.cs (26)
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, "Waiting",
ResourceCommandState
.Disabled)]
19
[InlineData(CommandsConfigurationExtensions.StartCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
20
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Starting",
ResourceCommandState
.Hidden)]
21
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Stopping",
ResourceCommandState
.Disabled)]
22
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Running",
ResourceCommandState
.Enabled)]
23
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Exited",
ResourceCommandState
.Hidden)]
24
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Finished",
ResourceCommandState
.Hidden)]
25
[InlineData(CommandsConfigurationExtensions.StopCommandName, "FailedToStart",
ResourceCommandState
.Hidden)]
26
[InlineData(CommandsConfigurationExtensions.StopCommandName, "Waiting",
ResourceCommandState
.Hidden)]
27
[InlineData(CommandsConfigurationExtensions.StopCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Hidden)]
28
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Starting",
ResourceCommandState
.Disabled)]
29
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Stopping",
ResourceCommandState
.Disabled)]
30
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Running",
ResourceCommandState
.Enabled)]
31
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Exited",
ResourceCommandState
.Disabled)]
32
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Finished",
ResourceCommandState
.Disabled)]
33
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "FailedToStart",
ResourceCommandState
.Disabled)]
34
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "Waiting",
ResourceCommandState
.Disabled)]
35
[InlineData(CommandsConfigurationExtensions.RestartCommandName, "RuntimeUnhealthy",
ResourceCommandState
.Disabled)]
36
public void LifeCycleCommands_CommandState(string commandName, string resourceState,
ResourceCommandState
commandState)
46
var
state = startCommand.UpdateState(new UpdateCommandStateContext