46 references to ResourceCommandState
Aspire.Hosting (19)
ApplicationModel\CommandsConfigurationExtensions.cs (8)
36return ResourceCommandState.Disabled; 40return ResourceCommandState.Enabled; 44return ResourceCommandState.Hidden; 68return ResourceCommandState.Disabled; 72return ResourceCommandState.Enabled; 76return ResourceCommandState.Hidden; 101return ResourceCommandState.Disabled; 105return ResourceCommandState.Enabled;
ApplicationModel\CustomResourceSnapshot.cs (1)
222public 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)
20Func<UpdateCommandStateContext, ResourceCommandState> updateState, 60public Func<UpdateCommandStateContext, ResourceCommandState> UpdateState { get; }
ApplicationModel\ResourceNotificationService.cs (2)
416var newState = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = _serviceProvider }); 459var state = annotation.UpdateState(new UpdateCommandStateContext { ResourceSnapshot = previousState, ServiceProvider = serviceProvider });
Dashboard\proto\Partials.cs (4)
115private static ResourceCommandState MapCommandState(Hosting.ApplicationModel.ResourceCommandState state) 119Hosting.ApplicationModel.ResourceCommandState.Enabled => ResourceCommandState.Enabled, 120Hosting.ApplicationModel.ResourceCommandState.Disabled => ResourceCommandState.Disabled, 121Hosting.ApplicationModel.ResourceCommandState.Hidden => ResourceCommandState.Hidden,
ResourceBuilderExtensions.cs (2)
988Func<UpdateCommandStateContext, ResourceCommandState>? updateState = null, 1008return 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)
95updateState: 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)] 36public void LifeCycleCommands_CommandState(string commandName, string resourceState, ResourceCommandState commandState) 46var state = startCommand.UpdateState(new UpdateCommandStateContext