5 instantiations of ResourceCommandSnapshot
Aspire.Hosting (1)
ApplicationModel\ResourceNotificationService.cs (1)
1158
return new
ResourceCommandSnapshot
(annotation.Name, state, annotation.DisplayName, annotation.DisplayDescription, annotation.Parameter, annotation.ConfirmationMessage, annotation.IconName, annotation.IconVariant, annotation.IsHighlighted)
Aspire.Hosting.Tests (4)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (3)
208
new
ResourceCommandSnapshot
("start", ResourceCommandState.Enabled, "Start", "Start the resource", null, null, null, null, false)
238
new
ResourceCommandSnapshot
("stop", ResourceCommandState.Disabled, "Stop", "Stop the resource", null, null, null, null, false),
239
new
ResourceCommandSnapshot
("restart", ResourceCommandState.Hidden, "Restart", null, null, null, null, null, true)
ResourceNotificationTests.cs (1)
1837
return
new
("command", ResourceCommandState.Enabled, "Command", DisplayDescription: null, Parameter: null, ConfirmationMessage: null, IconName: null, IconVariant: null, IsHighlighted: false)
14 references to ResourceCommandSnapshot
Aspire.Hosting (11)
ApplicationModel\CustomResourceSnapshot.cs (1)
120
public ImmutableArray<
ResourceCommandSnapshot
> Commands { get; init; } = [];
ApplicationModel\ResourceNotificationService.cs (8)
1092
ImmutableArray<
ResourceCommandSnapshot
>.Builder? builder = null;
1096
var
existingCommand = FindByName(previousState.Commands, annotation.Name);
1102
builder = ImmutableArray.CreateBuilder<
ResourceCommandSnapshot
>(previousState.Commands.Length);
1118
builder = ImmutableArray.CreateBuilder<
ResourceCommandSnapshot
>(previousState.Commands.Length);
1122
var
newCommand = existingCommand with
1140
static
ResourceCommandSnapshot
? FindByName(ImmutableArray<
ResourceCommandSnapshot
> commands, string name)
1153
static
ResourceCommandSnapshot
CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider)
Dashboard\proto\Partials.cs (1)
116
foreach (
var
command in snapshot.Commands.Where(command => command.Visibility.HasFlag(Hosting.ApplicationModel.ResourceCommandVisibility.UI)))
Dashboard\ResourceSnapshot.cs (1)
30
public required ImmutableArray<
ResourceCommandSnapshot
> Commands { get; init; }
Aspire.Hosting.Azure.Tests (2)
AzureEnvironmentResourceExtensionsTests.cs (2)
1669
var
cancelCommand = Assert.Single(storageEvent.Snapshot.Commands, c => c.Name == AzureProvisioningController.CancelCommandName);
5054
var
command = Assert.Single(snapshot.Commands, c => c.Name == commandName);
Aspire.Hosting.Tests (1)
ResourceNotificationTests.cs (1)
1834
private static
ResourceCommandSnapshot
CreateTestCommand(IReadOnlyList<InteractionInput> arguments)