Class Config
An abstraction of a config file on disk, which handles synchronizing between a memory representation and the disk representation.
Inheritance
Inherited Members
Namespace: IPA.Config
Assembly: IPA.Loader.dll
Syntax
public class Config
Properties
| Improve this Doc View SourceName
Gets the name associated with this Config object.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Provider
Gets the IConfigProvider associated with this Config object.
Declaration
public IConfigProvider Provider { get; }
Property Value
Type | Description |
---|---|
IConfigProvider |
Methods
| Improve this Doc View SourceGetConfigFor(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 |
---|---|---|
System.String | configName | the name of the mod for this config |
System.String[] | extensions | the preferred config types to try to get |
Returns
Type | Description |
---|---|
Config | a Config using the requested format, or of type JSON. |
LoadAsync()
Forces an asynchronous load from disk.
Declaration
public Task LoadAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
LoadSync()
Forces a synchronous load from disk.
Declaration
public void LoadSync()
Register(Type)
Registers a IConfigProvider to use for configs.
Declaration
public static void Register(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | the type to register |
Register<T>()
Registers a IConfigProvider to use for configs.
Declaration
public static void Register<T>()
where T : IConfigProvider, new()
Type Parameters
Name | Description |
---|---|
T | the type to register |
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 |
---|---|
System.InvalidOperationException | If this was called before. |