Interface ICommandInstance
Represents a command instance.
Namespace: TehGM.Wolfringo.Commands.Initialization
Assembly: Wolfringo.Commands.dll
Syntax
public interface ICommandInstance
Methods
| Improve this Doc View SourceCheckMatchAsync(ICommandContext, IServiceProvider, CancellationToken)
Determines whether the command should execute.
Declaration
Task<ICommandResult> CheckMatchAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandContext | context | Context of the command. |
IServiceProvider | services | Service provider that can be used during the checks. |
CancellationToken | cancellationToken | Cancellation token to cancel the checks. |
Returns
Type | Description |
---|---|
Task<ICommandResult> | Result of the check. |
ExecuteAsync(ICommandContext, IServiceProvider, ICommandResult, Object, CancellationToken)
Executes the command.
Declaration
Task<ICommandResult> ExecuteAsync(ICommandContext context, IServiceProvider services, ICommandResult matchResult, object handler, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandContext | context | Context of the command. |
IServiceProvider | services | Services provider for injecting parameters into command method. |
ICommandResult | matchResult | Result of the pre-run check. |
Object | handler | Handler object to execute the command method in. |
CancellationToken | cancellationToken | Cancellation token to cancel the execution. |
Returns
Type | Description |
---|---|
Task<ICommandResult> | Result of the execution. |