swiftlys2/docs/api/ai/
API Reference Services

IPluginConfigurationService

Interface
Namespace: SwiftlyS2.Shared.Services · Assembly: SwiftlyS2.CS2.dll
public interface IPluginConfigurationService
View source

Properties

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
Returns
The plugin configuration service.

GetConfigPath(string)

Get the path to the configuration file.

string GetConfigPath(string name)
Parameters
  • namestringThe name of the configuration file, including the extension.
Returns
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
  • namestringThe name of the configuration file.
  • sectionNamestringThe name of the section in the configuration file.

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
  • namestringThe name of the configuration file.
  • sectionNamestringThe name of the section in the configuration file.

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
  • namestringThe name of the configuration file.
  • templateNamestringThe name of the template file.