Interface ITerminalEventHandler
The terminal event handler.
public interface ITerminalEventHandler
Methods
AfterCommandCheckAsync(Command, CommandCheckerResult)
Override this method if you will perform an asynchronous operation after ICommandHandler ends a command check.
Task AfterCommandCheckAsync(Command command, CommandCheckerResult result)
Parameters
command
CommandThe command object.
result
CommandCheckerResultThe command run result.
Returns
Remarks
The framework will not call AfterCommandCheckAsync(Command, CommandCheckerResult) if there is an error during the command check.
AfterCommandRouteAsync(CommandRoute, Command?, CommandRouterResult?)
Override this method if you will perform an asynchronous operation after ICommandRouter ends a command route and process the command result.
Task AfterCommandRouteAsync(CommandRoute commandRoute, Command? command, CommandRouterResult? result)
Parameters
commandRoute
CommandRouteThe command route.
command
CommandThe command object. May be
null
.result
CommandRouterResultThe command router result. May be
null
.
Returns
Remarks
The framework will call AfterCommandRouteAsync(CommandRoute, Command?, CommandRouterResult?) even if there is an error during command routing.
The command
and result
parameters may be null
. The router constructs a command
object if the parser, handler, and checker pass
and routes a command to run.
AfterCommandRunAsync(Command, CommandRunnerResult)
Override this method if you will perform an asynchronous operation after ICommandHandler ends a command run and process the command result.
Task AfterCommandRunAsync(Command command, CommandRunnerResult result)
Parameters
command
CommandThe command object.
result
CommandRunnerResultThe command run result.
Returns
Remarks
The framework will not call AfterCommandRunAsync(Command, CommandRunnerResult) if there is an error during the command run.
BeforeCommandCheckAsync(Command)
Override this method if you will perform an asynchronous operation before ICommandHandler starts a command check.
Task BeforeCommandCheckAsync(Command command)
Parameters
command
CommandThe command object.
Returns
BeforeCommandRouteAsync(CommandRoute)
Override this method if you will perform an asynchronous operation before ICommandRouter starts a command route.
Task BeforeCommandRouteAsync(CommandRoute commandRoute)
Parameters
commandRoute
CommandRouteThe command route.
Returns
BeforeCommandRunAsync(Command)
Override this method if you will perform an asynchronous operation before ICommandHandler starts a command run.
Task BeforeCommandRunAsync(Command command)
Parameters
command
CommandThe command object.