Bagikan melalui


IChainedCommandHandler<T>.GetCommandState Method

Definition

Called to determine the state of the command. This method should never return Unspecified as it would prevent calling following command handlers. nextCommandHandler should be called instead. If a IChainedCommandHandler<T> handles a command it doesn't own, its GetCommandState(T, Func<CommandState>) should always call nextCommandHandler" to give a chance a ICommandHandler that owns the command to enable or disable it.

public:
 Microsoft::VisualStudio::Commanding::CommandState GetCommandState(T args, Func<Microsoft::VisualStudio::Commanding::CommandState> ^ nextCommandHandler);
public Microsoft.VisualStudio.Commanding.CommandState GetCommandState (T args, Func<Microsoft.VisualStudio.Commanding.CommandState> nextCommandHandler);
abstract member GetCommandState : 'T * Func<Microsoft.VisualStudio.Commanding.CommandState> -> Microsoft.VisualStudio.Commanding.CommandState
Public Function GetCommandState (args As T, nextCommandHandler As Func(Of CommandState)) As CommandState

Parameters

args
T

The CommandArgs arguments for the command.

nextCommandHandler
Func<CommandState>

The next command handler in the command execution chain.

Returns

A CommandState instance that contains information on the availability of the command.

Applies to