Partilhar via


ResourceCommandAnnotation Class

Definition

Represents a command annotation for a resource.

public sealed class ResourceCommandAnnotation : Aspire.Hosting.ApplicationModel.IResourceAnnotation
type ResourceCommandAnnotation = class
    interface IResourceAnnotation
Public NotInheritable Class ResourceCommandAnnotation
Implements IResourceAnnotation
Inheritance
ResourceCommandAnnotation
Implements

Constructors

ResourceCommandAnnotation(String, String, Func<UpdateCommandStateContext, ResourceCommandState>, Func<ExecuteCommandContext,Task<ExecuteCommandResult>>, String, Object, String, String, Nullable<IconVariant>, Boolean)

Initializes a new instance of the ResourceCommandAnnotation class.

Properties

ConfirmationMessage

When a confirmation message is specified, the UI will prompt with an OK/Cancel dialog and the confirmation message before starting the command.

DisplayDescription

Optional description of the command, to be shown in the UI. Could be used as a tooltip. May be localized.

DisplayName

The display name visible in UI.

ExecuteCommand

A callback that is executed when the command is executed. The result is used to indicate success or failure in the UI.

IconName

The icon name for the command. The name should be a valid FluentUI icon name. https://aka.ms/fluentui-system-icons

IconVariant

The icon variant for the command.

IsHighlighted

A flag indicating whether the command is highlighted in the UI.

Name

The name of command. The name uniquely identifies the command.

Parameter

Optional parameter that configures the command in some way. Clients must return any value provided by the server when invoking the command.

UpdateState

A callback that is used to update the command state. The callback is executed when the command's resource snapshot is updated.

Applies to