Class CommandServiceExtensions
Provides extension methods for the CommandService class.
public static class CommandServiceExtensions
- Inheritance
-
CommandServiceExtensions
- Inherited Members
Methods
GetExecutableCommandsAsync(CommandService, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider)
Parameters
commandServiceCommandServiceThe desired command service class to check against.
contextICommandContextThe current command context.
providerIServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.
GetExecutableCommandsAsync(ModuleInfo, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)
Parameters
moduleModuleInfoThe module to be checked against.
contextICommandContextThe current command context.
providerIServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.
GetExecutableCommandsAsync(ICollection<CommandInfo>, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ICollection<CommandInfo> commands, ICommandContext context, IServiceProvider provider)
Parameters
commandsICollection<CommandInfo>The set of commands to be checked against.
contextICommandContextThe current command context.
providerIServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.