Show / Hide Table of Contents

# Class Config

An abstraction of a config file on disk, which handles synchronizing between a memory representation and the disk representation.

##### 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 class Config

### Properties

| Improve this Doc View Source

#### Name

Gets the name associated with this Config object.

##### Declaration

    public string Name { get; }

##### Property Value

Type | Description
--- | ---
String |

| Improve this Doc View Source

#### Provider

Gets the IConfigProvider associated with this Config object.

##### Declaration

    public IConfigProvider Provider { get; }

##### Property Value

Type | Description
--- | ---
IConfigProvider |

### Methods

| Improve this Doc View Source

#### GetConfigFor(String, String[])

Gets a Config object using the specified list of preferred config types.

##### Declaration

    public static Config GetConfigFor(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
--- | ---
Config | a Config using the requested format, or of type JSON.

| Improve this Doc View Source

#### LoadAsync()

Forces an asynchronous load from disk.

##### Declaration

    public Task LoadAsync()

##### Returns

Type | Description
--- | ---
Task |

| Improve this Doc View Source

#### LoadSync()

Forces a synchronous load from disk.

##### Declaration

    public void LoadSync()

| 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

#### SetStore(IConfigStore)

Sets this object's IConfigStore. Can only be called once.

##### Declaration

    public void SetStore(IConfigStore store)

##### Parameters

Type | Name | Description
--- | --- | ---
IConfigStore | store | the IConfigStore to add to this instance

##### Exceptions

Type | Condition
--- | ---
InvalidOperationException | If this was called before.

### Extension Methods

ReflectionUtil.SetField<T, U>(T, String, U)
ReflectionUtil.GetField<U, T>(T, String)
ReflectionUtil.SetProperty<T, U>(T, String, U)
ReflectionUtil.GetProperty<U, T>(T, String)
ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])
GeneratedStore.Generated<T>(Config, Boolean)