Class SettingsGroup
Abstract class providing common functionality for settings group concrete implementations
Implements
Inherited Members
Namespace: Sdl.Core.Settings
Assembly: Sdl.Core.Settings.dll
Syntax
public abstract class SettingsGroup : AbstractSettingsGroupBase, ISettingsGroup
Constructors
SettingsGroup()
Declaration
protected SettingsGroup()
Properties
Id
Gets the id of the settings group.
Declaration
public override string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Parent
Gets the parent settings group in the parent bundle, or null if this settings group belongs to the root settings bundle.
Declaration
public override ISettingsGroup Parent { get; }
Property Value
Type | Description |
---|---|
ISettingsGroup |
Overrides
SettingsBundle
The settings bundle this group belongs to
Declaration
public override ISettingsBundle SettingsBundle { get; set; }
Property Value
Type | Description |
---|---|
ISettingsBundle |
Overrides
Methods
BeginEdit()
Begins and edit on an object
Declaration
public override void BeginEdit()
Overrides
CancelEdit()
Discards changes since the last System.ComponentModel.IEditableObject.BeginEdit() call.
Declaration
public override void CancelEdit()
Overrides
CollectSettings(ISettingsGroup, List<String>)
Declaration
protected override void CollectSettings(ISettingsGroup settingsGroup, List<string> keys)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | |
System.Collections.Generic.List<System.String> | keys |
Overrides
ContainsSetting(String)
Returns true if settingId is found in the current settings collection or in any ancestor's settings collection
Declaration
public override bool ContainsSetting(string settingId)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | the settingsId to find |
Returns
Type | Description |
---|---|
System.Boolean | true if settingId is found in the current settings collection or in any ancestor's settings collection |
Overrides
EndEdit()
Pushes changes since the last System.ComponentModel.IEditableObject.BeginEdit() or System.ComponentModel.IBindingList.AddNew() call into the underlying object.
Declaration
public override void EndEdit()
Overrides
GetDefaultValue(String)
Gets the default value for the sepcified settings. Always returns null. Override this method in extending classes to define default setting values.
Declaration
protected virtual object GetDefaultValue(string settingId)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | The setting id. |
Returns
Type | Description |
---|---|
System.Object | The default value, or null if no default value is available. |
GetSetting<T>(String)
Gets the setting with the specified id.
Declaration
public override Setting<T> GetSetting<T>(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id of the setting. |
Returns
Type | Description |
---|---|
Setting<T> | The setting. |
Type Parameters
Name | Description |
---|---|
T | The type of the setting value. |
Overrides
Remarks
When no value is defined in the settings group itself, the parent chain is searched for an inherited value. If no inherited value can be found, the default value provided by the settings group implementation is returned.
GetSetting<T>(String, T)
Gets the setting with the specified id.
Declaration
public override Setting<T> GetSetting<T>(string settingId, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | The id of the setting. |
T | defaultValue | The default value for the setting if no value can be found. |
Returns
Type | Description |
---|---|
Setting<T> | The setting. |
Type Parameters
Name | Description |
---|---|
T | The type of the setting value. |
Overrides
Remarks
When no value is defined in the settings group itself, the parent chain is searched for an inherited value. If no inherited value can be found, the default value provided by the settings group implementation is returned.
GetSetting<T>(String, out T)
Gets the setting with the specified id.
Declaration
public override bool GetSetting<T>(string settingId, out T value)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | The id of the setting. |
T | value | The value of the setting. |
Returns
Type | Description |
---|---|
System.Boolean | True if a setting value has been returned. |
Type Parameters
Name | Description |
---|---|
T | The type of the setting value. |
Overrides
Remarks
When no value is defined in the settings group itself, the parent chain is searched for an inherited value. If no inherited value can be found, null is returned.
GetSetting<T>(String, out Setting<T>)
Gets the setting with the specified id.
Declaration
public override bool GetSetting<T>(string settingId, out Setting<T> setting)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | The id of the setting. |
Setting<T> | setting | The setting, or null if no value was defined. |
Returns
Type | Description |
---|---|
System.Boolean | True if a setting value has been returned. |
Type Parameters
Name | Description |
---|---|
T | The type of the setting value. |
Overrides
Remarks
When no value is defined in the settings group itself, the parent chain is searched for an inherited value. If no inherited value can be found, null is returned.
GetSettingIds()
Gets the setting ids from the current settings group.
Declaration
public override IEnumerable<string> GetSettingIds()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The setting ids. |
Overrides
ImportSettings(ISettingsGroup)
Imports the settings from another group into this one. Resets the current settings before importing the settings from the other group.
Declaration
public override void ImportSettings(ISettingsGroup otherGroup)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | otherGroup | The group which the settings are imported from |
Overrides
OnInit(ISettingsBundle)
Called when SettingsBungle is set.
Declaration
protected virtual void OnInit(ISettingsBundle settingsBundle)
Parameters
Type | Name | Description |
---|---|---|
ISettingsBundle | settingsBundle | the value of the new ISettingsBundle |
parent_PropertyChanged(Object, PropertyChangedEventArgs)
Declaration
protected override void parent_PropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.ComponentModel.PropertyChangedEventArgs | e |
Overrides
parent_SettingsChanged(Object, SettingsChangedEventArgs)
Declaration
protected override void parent_SettingsChanged(object sender, SettingsChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
SettingsChangedEventArgs | e |
Overrides
RemoveSetting(String)
Removes a local setting from the this group. Returns true if the setting was successfully removed, false otherwise. i.e. if the setting doesn't exist, false is returned.
Declaration
public override bool RemoveSetting(string settingId)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingId | The id of the setting to remove |
Returns
Type | Description |
---|---|
System.Boolean | boolean indicating whether the setting was successfully removed |
Overrides
Reset()
Resets all settings locally defined in this settings group.
Declaration
public override void Reset()
Overrides
Events
PropertyChanged
Raised when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |