Interface IConfigurationService
Gets and sets configuration values
Namespace: Simplic.Configuration
Assembly: Simplic.Configuration.dll
Syntax
public interface IConfigurationService
Methods
| Improve this Doc View SourceCreate<T>(String, String, Int32, Boolean, T)
Create a new configuration entry
Declaration
void Create<T>(string configurationName, string pluginName, int type, bool editable, T configurationValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationName | Configuration name |
System.String | pluginName | Plugin name |
System.Int32 | type | Type (0 = string, 1 = int, 5 = bool) |
System.Boolean | editable | Determines whether the configuration is editable |
T | configurationValue | Configuration value |
Type Parameters
Name | Description |
---|---|
T |
Exists(String, String)
Checks whether a configuration exists
Declaration
bool Exists(string configurationName, string pluginName)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationName | Configuration name |
System.String | pluginName | Plugin name |
Returns
Type | Description |
---|---|
System.Boolean |
GetValue<T>(String, String, String, Boolean)
Gets a configuration value
Declaration
T GetValue<T>(string configurationName, string pluginName, string userName, bool noCaching = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationName | Name of the setting |
System.String | pluginName | Name of the plugin |
System.String | userName | Name of the user. Uses user-independent setting if empty |
System.Boolean | noCaching | If true, the value will not be loaded from the cache nor stored. |
Returns
Type | Description |
---|---|
T | Configuration value casted to |
Type Parameters
Name | Description |
---|---|
T | Target type |
GetValues<T>(String, String)
Get an enumerable of configuration values by its plugin name
Declaration
IEnumerable<ConfigurationValue> GetValues<T>(string pluginName, string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | Name of the plugin |
System.String | userName | Name of the user. Uses user-independent setting if empty |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ConfigurationValue> | Enumerable of values casted to |
Type Parameters
Name | Description |
---|---|
T | Expected type |
SetValue<T>(String, String, String, T)
Sets a configuration
Declaration
void SetValue<T>(string configurationName, string pluginName, string userName, T value)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationName | Name of the configuration |
System.String | pluginName | Name of the plugin |
System.String | userName | Name of the user. Uses user-independent setting if empty |
T | value | Configuration value |
Type Parameters
Name | Description |
---|---|
T | Input type |