Class CommandInitializerProvider
A provider of command initializers for specific command type.
Namespace: TehGM.Wolfringo.Commands.Initialization
Assembly: Wolfringo.Commands.dll
Syntax
public class CommandInitializerProvider : ICommandInitializerProvider, IDisposable
Remarks
This is a default initializer map, and contains all initializers provided with the Wolfringo.Commands library by default.
Constructors
| Improve this Doc View SourceCommandInitializerProvider()
Creates default command initializer map with default options.
Declaration
public CommandInitializerProvider()
CommandInitializerProvider(CommandInitializerProviderOptions)
Creates default command initializer map.
Declaration
public CommandInitializerProvider(CommandInitializerProviderOptions options)
Parameters
Type | Name | Description |
---|---|---|
CommandInitializerProviderOptions | options |
Properties
| Improve this Doc View SourceDisposeInitializers
Whether this provider will dispose initializers.
Declaration
protected bool DisposeInitializers { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This will be set to true if Options weren't provided to the constructor.
Disposing will happen when Dispose() is called.
Options
Options used by this provider.
Declaration
protected CommandInitializerProviderOptions Options { get; }
Property Value
Type | Description |
---|---|
CommandInitializerProviderOptions |
Methods
| Improve this Doc View SourceDispose()
Disposes the map.
Declaration
public virtual void Dispose()
Remarks
If any of the mapped initializers implements IDisposable, it'll also be disposed, unless options were provided via constructor from external source.
GetInitializer(Type)
Gets a command initializer for the command type.
Declaration
public virtual ICommandInitializer GetInitializer(Type commandAttributeType)
Parameters
Type | Name | Description |
---|---|---|
Type | commandAttributeType | Type of the command. |
Returns
Type | Description |
---|---|
ICommandInitializer | An initializer for provided command type. |
ThrowIfInvalidCommandType(Type)
Throws an exception if given command attribute is of incorrect type.
Declaration
protected void ThrowIfInvalidCommandType(Type commandAttributeType)
Parameters
Type | Name | Description |
---|---|---|
Type | commandAttributeType | Type of command attribute. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|