Class CommandRouter
The default ICommandRouter.
public sealed class CommandRouter : ICommandRouter
- Inheritance
-
CommandRouter
- Implements
- Inherited Members
Constructors
CommandRouter(TerminalOptions, ILicenseExtractor, ICommandParser, ICommandHandler, ILogger<CommandRouter>, ITerminalEventHandler?)
Initializes a new instance.
public CommandRouter(TerminalOptions terminalOptions, ILicenseExtractor licenseExtractor, ICommandParser commandParser, ICommandHandler commandHandler, ILogger<CommandRouter> logger, ITerminalEventHandler? asyncEventHandler = null)
Parameters
terminalOptions
TerminalOptionsThe configuration options.
licenseExtractor
ILicenseExtractorThe license extractor.
commandParser
ICommandParserThe command parser.
commandHandler
ICommandHandlerThe command handler.
logger
ILogger<CommandRouter>The logger.
asyncEventHandler
ITerminalEventHandlerThe event handler.
Methods
RouteCommandAsync(CommandRouterContext)
Routes the command request to the registered handler.
public Task<CommandRouterResult> RouteCommandAsync(CommandRouterContext context)
Parameters
context
CommandRouterContextThe router context.
Returns
- Task<CommandRouterResult>
The CommandRouterResult instance.