Interface IConfigProvider
An interface for configuration providers.
Namespace: IPA.Config
Assembly: IPA.Loader.dll
Syntax
public interface IConfigProvider
Properties
| Improve this Doc View SourceDynamic
Gets a dynamic object providing access to the configuration.
Declaration
dynamic Dynamic { get; }
Property Value
Type | Description |
---|---|
System.Object | a dynamically bound object to use to access config values directly |
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 |
---|---|
System.String | the extensionless filename to save to |
HasChanged
Returns true if object has changed since the last save
Declaration
bool HasChanged { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if object has changed since the last save, else false |
InMemoryChanged
Returns true if the data in memory has been changed - notably including loads.
Declaration
bool InMemoryChanged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the data in memory has been changed, else false |
LastModified
Gets the last time the config was modified.
Declaration
DateTime LastModified { get; }
Property Value
Type | Description |
---|---|
System.DateTime | the last time the config file was modified |
Methods
| Improve this Doc View SourceLoad()
Loads the state of the file on disk.
Declaration
void Load()
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 |
Save()
Saves configuration to file. Should error if not a root object.
Declaration
void Save()
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 |