Class CommandsLoaderExtensions
Extensions for a command loaders.
Namespace: TehGM.Wolfringo.Commands.Initialization
Assembly: Wolfringo.Commands.dll
Syntax
public static class CommandsLoaderExtensions
Methods
| Improve this Doc View SourceLoadFromAssembliesAsync(ICommandsLoader, IEnumerable<Assembly>, CancellationToken)
Loads all command instance descriptors from assemblies.
Declaration
public static async Task<IEnumerable<ICommandInstanceDescriptor>> LoadFromAssembliesAsync(this ICommandsLoader loader, IEnumerable<Assembly> assemblies, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandsLoader | loader | The loader to perform loading with. |
IEnumerable<Assembly> | assemblies | Assemblies to load descriptors from. |
CancellationToken | cancellationToken | Token that can be used to stop loading. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ICommandInstanceDescriptor>> | Enumerable of all loaded command descriptors. |
LoadFromMethodsAsync(ICommandsLoader, IEnumerable<MethodInfo>, CancellationToken)
Loads all command instance descriptors from methods.
Declaration
public static async Task<IEnumerable<ICommandInstanceDescriptor>> LoadFromMethodsAsync(this ICommandsLoader loader, IEnumerable<MethodInfo> methods, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandsLoader | loader | The loader to perform loading with. |
IEnumerable<MethodInfo> | methods | Methods to load descriptors from. |
CancellationToken | cancellationToken | Token that can be used to stop loading. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ICommandInstanceDescriptor>> | Enumerable of all loaded command descriptors. |
LoadFromTypesAsync(ICommandsLoader, IEnumerable<TypeInfo>, CancellationToken)
Loads all command instance descriptors from types.
Declaration
public static async Task<IEnumerable<ICommandInstanceDescriptor>> LoadFromTypesAsync(this ICommandsLoader loader, IEnumerable<TypeInfo> types, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandsLoader | loader | The loader to perform loading with. |
IEnumerable<TypeInfo> | types | Types to load descriptors from. |
CancellationToken | cancellationToken | Token that can be used to stop loading. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ICommandInstanceDescriptor>> | Enumerable of all loaded command descriptors. |