Show / Hide Table of Contents

Class SettingsManager

Implements methods to manage settings.

Inheritance
System.Object
SettingsManager
Implements
ISettingsManager
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Settings
Assembly: Sartorius.SAF.dll
Syntax
[Export(typeof(ISettingsManager))]
public class SettingsManager : ISettingsManager
Examples

The SettingsManager uses the ISettingService to store the settings. See the examples for the ISettingService and its SAF implementation to set required and optional settings to control the behavior how and where the settings are stored.

Constructors

View Source

SettingsManager(IServiceFactory)

Initializes a new instance of the SettingsManager class.

Declaration
[ImportingConstructor]
public SettingsManager(IServiceFactory serviceFactory)
Parameters
Type Name Description
IServiceFactory serviceFactory

An instance of IServiceFactory.

Properties

View Source

IsActive

Indicates whether the ISettingsManager is active.

Declaration
public bool IsActive { get; }
Property Value
Type Description
System.Boolean
Remarks

Might be inactive if there is no underlying implementation of the ISettingService.

Methods

View Source

DeleteSetting(SettingScope, String)

Deletes the setting with the given key.

Declaration
public void DeleteSetting(SettingScope settingScope, string key)
Parameters
Type Name Description
SettingScope settingScope

The SettingScope.

System.String key

The setting key.

Examples
       settingsManager.DeleteSetting(SettingScope.Application, "SystemCulture");
View Source

ReadSetting<T>(SettingScope, String)

Reads the setting with the given key.

Declaration
public T ReadSetting<T>(SettingScope settingScope, string key)
    where T : class
Parameters
Type Name Description
SettingScope settingScope

The SettingScope.

System.String key

The setting key.

Returns
Type Description
T

The setting, or null if not setting was found.

Type Parameters
Name Description
T
View Source

ReadUserSetting<T>(String)

Reads the user setting with the given key.

Declaration
public T ReadUserSetting<T>(string key)
    where T : class
Parameters
Type Name Description
System.String key

The setting key.

Returns
Type Description
T

The setting or null if not setting was found.

Type Parameters
Name Description
T
View Source

SaveSetting(SettingScope, String, Object)

Saves a setting with the given key.

Declaration
public void SaveSetting(SettingScope settingScope, string key, object value)
Parameters
Type Name Description
SettingScope settingScope

The SettingScope.

System.String key

The setting key.

System.Object value

The setting value.

View Source

SaveUserSetting(String, Object)

Saves a user setting with the given key.

Declaration
public void SaveUserSetting(string key, object value)
Parameters
Type Name Description
System.String key

The setting key.

System.Object value

The setting value.

Implements

ISettingsManager

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX