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
terminalOptionsTerminalOptionsThe configuration options.
licenseExtractorILicenseExtractorThe license extractor.
commandParserICommandParserThe command parser.
commandHandlerICommandHandlerThe command handler.
loggerILogger<CommandRouter>The logger.
asyncEventHandlerITerminalEventHandlerThe event handler.
Methods
RouteCommandAsync(CommandContext)
Routes the command request to the registered handler.
public Task<CommandResult> RouteCommandAsync(CommandContext context)
Parameters
contextCommandContextThe router context.
Returns
- Task<CommandResult>
The CommandResult instance.