Class CommandServiceExtensions
提供用于 CommandService 的扩展方法。
public static class CommandServiceExtensions
- Inheritance
-
CommandServiceExtensions
- Inherited Members
Methods
GetExecutableCommandsAsync(CommandService, ICommandContext, IServiceProvider)
获取可以在当前上下文下执行的命令。
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider)
Parameters
commandServiceCommandService要检查的命令服务。
contextICommandContext当前命令上下文。
providerIServiceProvider用于检查时的依赖注入的服务提供程序。
Returns
- Task<IReadOnlyCollection<CommandInfo>>
可以在当前上下文下执行的所有命令。
GetExecutableCommandsAsync(ModuleInfo, ICommandContext, IServiceProvider)
获取可以在当前上下文下执行的命令。
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)
Parameters
moduleModuleInfo要检查的模块。
contextICommandContext当前命令上下文。
providerIServiceProvider用于检查时的依赖注入的服务提供程序。
Returns
- Task<IReadOnlyCollection<CommandInfo>>
所提供的模块中可以在当前上下文下执行的所有命令。
GetExecutableCommandsAsync(ICollection<CommandInfo>, ICommandContext, IServiceProvider)
获取可以在当前上下文下执行的命令。
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ICollection<CommandInfo> commands, ICommandContext context, IServiceProvider provider)
Parameters
commandsICollection<CommandInfo>要检查的命令。
contextICommandContext当前命令上下文。
providerIServiceProvider用于检查时的依赖注入的服务提供程序。
Returns
- Task<IReadOnlyCollection<CommandInfo>>
所提供的命令中可以在当前上下文下执行的所有命令。