Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class CommandInitializerProvider

    A provider of command initializers for specific command type.

    Inheritance
    System.Object
    CommandInitializerProvider
    Implements
    ICommandInitializerProvider
    System.IDisposable
    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 Source

    CommandInitializerProvider()

    Creates default command initializer map with default options.

    Declaration
    public CommandInitializerProvider()
    | Improve this Doc View Source

    CommandInitializerProvider(CommandInitializerProviderOptions)

    Creates default command initializer map.

    Declaration
    public CommandInitializerProvider(CommandInitializerProviderOptions options)
    Parameters
    Type Name Description
    CommandInitializerProviderOptions options

    Properties

    | Improve this Doc View Source

    DisposeInitializers

    Whether this provider will dispose initializers.

    Declaration
    protected bool DisposeInitializers { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    This will be set to true if Options weren't provided to the constructor.

    Disposing will happen when Dispose() is called.

    | Improve this Doc View Source

    Options

    Options used by this provider.

    Declaration
    protected CommandInitializerProviderOptions Options { get; }
    Property Value
    Type Description
    CommandInitializerProviderOptions

    Methods

    | Improve this Doc View Source

    Dispose()

    Disposes the map.

    Declaration
    public virtual void Dispose()
    Remarks

    If any of the mapped initializers implements System.IDisposable, it'll also be disposed, unless options were provided via constructor from external source.

    | Improve this Doc View Source

    GetInitializer(Type)

    Gets a command initializer for the command type.

    Declaration
    public virtual ICommandInitializer GetInitializer(Type commandAttributeType)
    Parameters
    Type Name Description
    System.Type commandAttributeType

    Type of the command.

    Returns
    Type Description
    ICommandInitializer

    An initializer for provided command type.

    | Improve this Doc View Source

    ThrowIfInvalidCommandType(Type)

    Throws an exception if given command attribute is of incorrect type.

    Declaration
    protected void ThrowIfInvalidCommandType(Type commandAttributeType)
    Parameters
    Type Name Description
    System.Type commandAttributeType

    Type of command attribute.

    Exceptions
    Type Condition
    System.ArgumentException

    commandAttributeType does not inherit from CommandAttributeBase.

    Implements

    ICommandInitializerProvider
    System.IDisposable

    Extension Methods

    CommandInitializerProviderExtensions.GetMappedInitializer<T>(ICommandInitializerProvider)