Search Results for

    Show / Hide Table of Contents

    Class PluginInitInjector

    The type that handles value injecting into a plugin's initialization methods.

    Inheritance
    System.Object
    PluginInitInjector
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: IPA.Loader
    Assembly: IPA.Loader.dll
    Syntax
    public static class PluginInitInjector
    Remarks

    The default injectors and what they provide are shown in this table.

    Parameter TypeInjected Value
    LoggerA StandardLogger specialized for the plugin being injected
    PluginMetadataThe PluginMetadata of the plugin being injected
    ConfigA Config object for the plugin being injected.

    These parameters may have Config.NameAttribute and Config.PreferAttribute to control how it is constructed.

    IAntiMalwareThe IAntiMalware instance which should be used for any potentially dangerous files.
    For all of the default injectors, only one of each will be generated, and any later parameters will recieve the same value as the first one.

    Methods

    | Improve this Doc View Source

    AddInjector(Type, PluginInitInjector.InjectParameter)

    Adds an injector to be used when calling future plugins' Init methods.

    Declaration
    public static void AddInjector(Type type, PluginInitInjector.InjectParameter injector)
    Parameters
    Type Name Description
    System.Type type

    the type of the parameter.

    PluginInitInjector.InjectParameter injector

    the function to call for injection.

    | Improve this Doc View Source

    AddInjector(Type, PluginInitInjector.InjectParameterNested)

    Adds an injector to be used when calling future plugins' Init methods.

    Declaration
    public static void AddInjector(Type type, PluginInitInjector.InjectParameterNested injector)
    Parameters
    Type Name Description
    System.Type type

    the type of the parameter.

    PluginInitInjector.InjectParameterNested injector

    the function to call for injection.

    | Improve this Doc View Source

    Inject<T>(PluginInitInjector.InjectedValueProvider, ParameterInfo)

    Invokes the provider with param and T and casts the result to T.

    Declaration
    public static T Inject<T>(this PluginInitInjector.InjectedValueProvider provider, ParameterInfo param)
    Parameters
    Type Name Description
    PluginInitInjector.InjectedValueProvider provider

    the provider to invoke.

    System.Reflection.ParameterInfo param

    the parameter to provide for

    Returns
    Type Description
    T

    the value requested, or null.

    Type Parameters
    Name Description
    T

    the type of object to be injected

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX