IPluginConfigurationService
Interface IPluginConfigurationService
Namespace: SwiftlyS2.Shared.Services
Assembly: SwiftlyS2.CS2.dll
public interface IPluginConfigurationServiceProperties
BasePath
Get the base path of plugin configuration.
string BasePath { get; }Property Value
BasePathExists
Whether the base path exists in the file system.
bool BasePathExists { get; }Property Value
Manager
Get the configuration root.
IConfigurationManager Manager { get; }Property Value
Methods
Configure(Action<IConfigurationBuilder>)
Configure the internal configuration manager.
IPluginConfigurationService Configure(Action<IConfigurationBuilder> configure)Parameters
- configure Action<IConfigurationBuilder> — The action to configure the configuration manager.
Returns
- IPluginConfigurationService — The plugin configuration service.
GetConfigPath(string)
Get the path to the configuration file.
string GetConfigPath(string name)Parameters
- name string — The name of the configuration file, including the extension.
Returns
- string — The path to the configuration file.
InitializeJsonWithModel<T>(string, string)
Initialize the json configuration file with a class as template.
IPluginConfigurationService InitializeJsonWithModel<T>(string name, string sectionName) where T : class, new()Parameters
- name string — The name of the configuration file.
- sectionName string — The name of the section in the configuration file.
Returns
Type Parameters
- T — The type of the configuration model.
InitializeTomlWithModel<T>(string, string)
Initialize the TOML configuration file with a class as template.
IPluginConfigurationService InitializeTomlWithModel<T>(string name, string sectionName) where T : class, new()Parameters
- name string — The name of the configuration file.
- sectionName string — The name of the section in the configuration file.
Returns
Type Parameters
- T — The type of the configuration model.
InitializeWithTemplate(string, string)
Initialize the configuration file with a template. To use this, you must package a templates folder in the plugin, with the template file in it.
IPluginConfigurationService InitializeWithTemplate(string name, string templateName)Parameters
- name string — The name of the configuration file.
- templateName string — The name of the template file.
Returns