Condividi tramite


CommandSet Class

Definition

Provides functionality for extending Visual Studio through brokered services.

public sealed class CommandSet : Microsoft.VisualStudio.Extensibility.ExtensionPart, IDisposable, Microsoft.VisualStudio.Extensibility.Commands.ICommandSet
type CommandSet = class
    inherit ExtensionPart
    interface ICommandSet
    interface IDisposable
Public NotInheritable Class CommandSet
Inherits ExtensionPart
Implements ICommandSet, IDisposable
Inheritance
CommandSet
Implements

Constructors

CommandSet(VisualStudioExtensibility, Extension, IServiceProvider, ICommandSetFactory)

Initializes a new instance of the CommandSet class.

Properties

Item[String]

Gets a registered command instance on this command set.

Methods

GetDynamicCommandAnchor<T>()

Gets a registered command instance on this command set.

InitializeAsync(IServiceBroker, Update, CancellationToken)

Allows the command set to initialize asynchronously.

RegisterAnchoredCommand(IDynamicCommand, String)

Register an existing command implementation that is to be parented to a dynamic command anchor.

RegisterCommand(ICommand)

Register an existing command implementation. This is only for commands that are also registered in extension.json.

RegisterCommandAsync(Type)

Registers a command defined by the provided type. This is only for commands that are also registered in extension.json.

RegisterCommandAsync<T>()

Registers a command from a given type. This is only for commands that are also registered in extension.json.

RegisterDynamicCommandAnchorAsync(Type)

Registers a command anchor defined by the provided type. This is only for command anchors that are also registered in extension.json.

UnregisterDynamicCommand(String)

Unregister a command.

Events

CommandAdded

Event to be triggered when a new command is added to the command set.

CommandRemoved

Event to be triggered when a command is removed from the command set.

Explicit Interface Implementations

ICommandSet.Commands

Gets the list of commands for this command set. Each command must have a unique Id within this collection.

Applies to