Share via


DynamicCommandAnchor.AddCommand(CommandMetadata, CommandCallbackAsync) Method

Definition

Register a command instance using command name and handler and anchor it to this group.

public Microsoft.VisualStudio.Extensibility.Commands.IExecutableCommand AddCommand (Microsoft.VisualStudio.RpcContracts.Commands.CommandMetadata metadata, Microsoft.VisualStudio.Extensibility.Commands.CommandCallbackAsync commandHandler);
member this.AddCommand : Microsoft.VisualStudio.RpcContracts.Commands.CommandMetadata * Microsoft.VisualStudio.Extensibility.Commands.CommandCallbackAsync -> Microsoft.VisualStudio.Extensibility.Commands.IExecutableCommand
Public Function AddCommand (metadata As CommandMetadata, commandHandler As CommandCallbackAsync) As IExecutableCommand

Parameters

metadata
CommandMetadata

Metadata related to the command that is being registered.

commandHandler
CommandCallbackAsync

Command handler.

Returns

Returns the registers command instance to set command state if required.

Applies to