Class PluginConfigurations
Configuration to store settings for a dalamud plugin.
Inheritance
Inherited Members
Namespace: Dalamud.Configuration
Assembly: Dalamud.dll
Syntax
public sealed class PluginConfigurations
Constructors
| Improve this Doc View SourcePluginConfigurations(String)
Initializes a new instance of the PluginConfigurations class.
Declaration
public PluginConfigurations(string storageFolder)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | storageFolder | Directory for storage of plugin configuration files. |
Methods
| Improve this Doc View SourceDelete(String)
Delete the configuration file and folder for the specified plugin. This will throw an System.IO.IOException if the plugin did not correctly close its handles.
Declaration
public void Delete(string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | The name of the plugin. |
GetConfigFile(String)
Get FileInfo to plugin config file.
Declaration
public FileInfo GetConfigFile(string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | InternalName of the plugin. |
Returns
| Type | Description |
|---|---|
| System.IO.FileInfo | FileInfo of the config file. |
GetDirectory(String)
Get plugin directory.
Declaration
public string GetDirectory(string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | Plugin name. |
Returns
| Type | Description |
|---|---|
| System.String | Plugin directory path. |
Load(String)
Load plugin configuration.
Declaration
public IPluginConfiguration Load(string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | Plugin name. |
Returns
| Type | Description |
|---|---|
| IPluginConfiguration | Plugin configuration. |
LoadForType<T>(String)
Load Plugin configuration. Parameterized deserialization. Currently this is called via reflection from DalamudPluginInterface.GetPluginConfig(). Eventually there may be an additional pluginInterface method that can call this directly without reflection - for now this is in support of the existing plugin api.
Declaration
public T LoadForType<T>(string pluginName)
where T : IPluginConfiguration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | Plugin Name. |
Returns
| Type | Description |
|---|---|
| T | Plugin Configuration. |
Type Parameters
| Name | Description |
|---|---|
| T | Configuration Type. |
Save(IPluginConfiguration, String)
Save/Load plugin configuration. NOTE: Save/Load are still using Type information for now, despite LoadForType superseding Load and not requiring or using it. It might be worth removing the Type info from Save, to strip it from all future saved configs, and then Load() can probably be removed entirely.
Declaration
public void Save(IPluginConfiguration config, string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| IPluginConfiguration | config | Plugin configuration. |
| System.String | pluginName | Plugin name. |