IChainedCommandHandler<T> Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a command handler that depends on behavior of following command handlers in the command execution chain formed from same strongly-typed ICommandHandlers ordered according to their [Order] attributes.
generic <typename T>
where T : CommandArgspublic interface class IChainedCommandHandler : Microsoft::VisualStudio::Commanding::ICommandHandler, Microsoft::VisualStudio::Utilities::INamed
public interface IChainedCommandHandler<T> : Microsoft.VisualStudio.Commanding.ICommandHandler, Microsoft.VisualStudio.Utilities.INamed where T : CommandArgs
type IChainedCommandHandler<'T (requires 'T :> CommandArgs)> = interface
interface ICommandHandler
interface INamed
Public Interface IChainedCommandHandler(Of T)
Implements ICommandHandler, INamed
Type Parameters
- T
- Implements
Examples
[Export(typeof(ICommandHandler))]
[Name(nameof(MyCommandHandler))]
[ContentType("text")]
[Order(Before ="OtherCommandHandler")]
[TextViewRole(PredefinedTextViewRoles.Editable)]
internal class MyCommandHandler : IChainedCommandHandler<MyCommandArgs>
Remarks
This is a MEF component part and should be exported as the non-generic ICommandHandler with required [Name], [ContentType] attributes and optional [Order] and [TextViewRole] attributes.
Properties
DisplayName |
Gets display name of an instance used to represent it to the user, for example when blaming it for delays. (Inherited from INamed) |
Methods
ExecuteCommand(T, Action, CommandExecutionContext) |
Called to execute the command.
If this implementation does not execute the command, |
GetCommandState(T, Func<CommandState>) |
Called to determine the state of the command.
This method should never return Unspecified as it would prevent calling following command handlers.
|
Extension Methods
ExecuteCommand<T>(ICommandHandler, T, Action, CommandExecutionContext) |
Called to execute the command. |
GetCommandState<T>(ICommandHandler, T, Func<CommandState>) |
Called to determine the state of the command. |