Class CommandRuntime
The default ICommandRuntime using CreateInstance(IServiceProvider, Type, params object[]), managing the resolution of of command checkers and runners.
public sealed class CommandRuntime : ICommandRuntime
- Inheritance
-
CommandRuntime
- Implements
- Inherited Members
Constructors
CommandRuntime(IServiceProvider, ILogger<CommandRuntime>)
Initializes a new instance of the CommandRuntime class.
public CommandRuntime(IServiceProvider serviceDescriptors, ILogger<CommandRuntime> logger)
Parameters
serviceDescriptors
IServiceProviderThe service provider for resolving service instances.
logger
ILogger<CommandRuntime>The logger for logging diagnostic messages.
Methods
ResolveCommandChecker(CommandDescriptor)
Resolves the command checker for a given command descriptor using dependency injection and activator utilities.
public ICommandChecker ResolveCommandChecker(CommandDescriptor commandDescriptor)
Parameters
commandDescriptor
CommandDescriptorThe command descriptor to identify the checker.
Returns
- ICommandChecker
The resolved command checker.
Exceptions
- TerminalException
Thrown if the command checker is not configured or invalid.
ResolveCommandRunner(CommandDescriptor)
Resolves the command runner for a given command descriptor using dependency injection and activator utilities.
public IDelegateCommandRunner ResolveCommandRunner(CommandDescriptor commandDescriptor)
Parameters
commandDescriptor
CommandDescriptorThe command descriptor to identify the runner.
Returns
- IDelegateCommandRunner
The resolved command runner.
Exceptions
- TerminalException
Thrown if the command runner is not configured or invalid.