Interface ISettingsProvider
Provides a set of methods to manage the application's settings.
Namespace: DevToys.Api
Assembly: DevToys.Api.dll
Syntax
public interface ISettingsProvider
Methods
GetSetting<T>(SettingDefinition<T>)
Gets the value of a defined setting.
Declaration
T GetSetting<T>(SettingDefinition<T> settingDefinition)
Parameters
Type | Name | Description |
---|---|---|
SettingDefinition<T> | settingDefinition | The SettingDefinition<T> that defines the targeted setting. |
Returns
Type | Description |
---|---|
T | Return the value of the setting or its default value. |
Type Parameters
Name | Description |
---|---|
T | The type of value that will be retrieved. |
ResetSetting<T>(SettingDefinition<T>)
Resets a given setting to its default value.
Declaration
void ResetSetting<T>(SettingDefinition<T> settingDefinition)
Parameters
Type | Name | Description |
---|---|---|
SettingDefinition<T> | settingDefinition |
Type Parameters
Name | Description |
---|---|
T |
SetSetting<T>(SettingDefinition<T>, T)
Sets the value of a given setting.
Declaration
void SetSetting<T>(SettingDefinition<T> settingDefinition, T value)
Parameters
Type | Name | Description |
---|---|---|
SettingDefinition<T> | settingDefinition | The SettingDefinition<T> that defines the targeted setting. |
T | value | The value to set |
Type Parameters
Name | Description |
---|---|
T | The type of value that will be set. |
Events
SettingChanged
Raised when a setting value has changed.
Declaration
event EventHandler<SettingChangedEventArgs>? SettingChanged
Event Type
Type | Description |
---|---|
EventHandler<SettingChangedEventArgs> |