Show / Hide Table of Contents

# Interface IConfigProvider

An interface for configuration providers.

###### Namespace: IPA.Config

###### Assembly: IPA.Loader.dll

##### Syntax

    public interface IConfigProvider

### Properties

| Improve this Doc View Source

#### Dynamic

Gets a dynamic object providing access to the configuration.

##### Declaration

    dynamic Dynamic { get; }

##### Property Value

Type | Description
--- | ---
Object | a dynamically bound object to use to access config values directly

| Improve this Doc View Source

#### Filename

Will be set with the filename (no extension) to save to. When saving, the implementation should add the appropriate extension. Should error if set multiple times.

##### Declaration

    string Filename { set; }

##### Property Value

Type | Description
--- | ---
String | the extensionless filename to save to

| Improve this Doc View Source

#### HasChanged

Returns true if object has changed since the last save

##### Declaration

    bool HasChanged { get; }

##### Property Value

Type | Description
--- | ---
Boolean | true if object has changed since the last save, else false

| Improve this Doc View Source

#### InMemoryChanged

Returns true if the data in memory has been changed - notably including loads.

##### Declaration

    bool InMemoryChanged { get; set; }

##### Property Value

Type | Description
--- | ---
Boolean | true if the data in memory has been changed, else false

| Improve this Doc View Source

#### LastModified

Gets the last time the config was modified.

##### Declaration

    DateTime LastModified { get; }

##### Property Value

Type | Description
--- | ---
DateTime | the last time the config file was modified

### Methods

| Improve this Doc View Source

#### Load()

Loads the state of the file on disk.

##### Declaration

    void Load()

| Improve this Doc View Source

#### Parse<T>()

Loads the data provided by this IConfigProvider into an object of type `T`.

##### Declaration

    T Parse<T>()

##### Returns

Type | Description
--- | ---
T | the values from the config provider parsed into the object

##### Type Parameters

Name | Description
--- | ---
T | the type of the object to parse into

| Improve this Doc View Source

#### Save()

Saves configuration to file. Should error if not a root object.

##### Declaration

    void Save()

| Improve this Doc View Source

#### Store<T>(T)

Stores the data from `obj` into the IConfigProvider.

##### Declaration

    void Store<T>(T obj)

##### Parameters

Type | Name | Description
--- | --- | ---
T | obj | the object containing the data to save

##### Type Parameters

Name | Description
--- | ---
T | the type of `obj`

### Extension Methods

Config.MakeLink<T>(IConfigProvider, Action<IConfigProvider, Ref<T>>)
Config.RemoveLinks(IConfigProvider)
ReflectionUtil.SetPrivateField(Object, String, Object)
ReflectionUtil.GetPrivateField<T>(Object, String)
ReflectionUtil.SetPrivateProperty(Object, String, Object)
ReflectionUtil.InvokePrivateMethod(Object, String, Object[])
ReflectionUtil.InvokePrivateMethod<T>(Object, String, Object[])