Show / Hide Table of Contents

    Class Config

    A class to handle updating ConfigProviders automatically

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

    Methods

    | Improve this Doc View Source

    GetProviderFor(String, String[])

    Gets an IConfigProvider using the specified list of preferred config types.

    Declaration
    public static IConfigProvider GetProviderFor(string configName, params string[] extensions)
    Parameters
    Type Name Description
    String configName

    the name of the mod for this config

    String[] extensions

    the preferred config types to try to get

    Returns
    Type Description
    IConfigProvider

    an IConfigProvider of the requested type, or of type JSON.

    | Improve this Doc View Source

    MakeLink<T>(IConfigProvider, Action<IConfigProvider, Ref<T>>)

    Creates a linked Ref<T> for the config provider. This Ref<T> will be automatically updated whenever the file on-disk changes.

    Declaration
    public static Ref<T> MakeLink<T>(this IConfigProvider config, Action<IConfigProvider, Ref<T>> onChange = null)
    Parameters
    Type Name Description
    IConfigProvider config

    the IConfigProvider to create a link to

    Action<IConfigProvider, Ref<T>> onChange

    an action to perform on value change

    Returns
    Type Description
    Ref<T>

    a Ref<T> to an ever-changing value, mirroring whatever the file contains.

    Type Parameters
    Name Description
    T

    the type of the parsed value

    | Improve this Doc View Source

    Register(Type)

    Registers a IConfigProvider to use for configs.

    Declaration
    public static void Register(Type type)
    Parameters
    Type Name Description
    Type type

    the type to register

    | Improve this Doc View Source

    Register<T>()

    Registers a IConfigProvider to use for configs.

    Declaration
    public static void Register<T>()
        where T : IConfigProvider
    Type Parameters
    Name Description
    T

    the type to register

    | Improve this Doc View Source

    RemoveLinks(IConfigProvider)

    Removes all linked Ref<T> such that they are no longer updated.

    Declaration
    public static void RemoveLinks(this IConfigProvider config)
    Parameters
    Type Name Description
    IConfigProvider config

    the IConfigProvider to unlink

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