Class SettingsProvider
- Namespace
- OpenSettings
- Assembly
- OpenSettings.dll
Provides static methods to retrieve local setting data and registration modes associated with settings. This class allows accessing settings by their type, full name, or other criteria, without needing to instantiate individual setting objects.
public static class SettingsProvider
- Inheritance
-
SettingsProvider
- Inherited Members
Methods
GetLocalSettingOrDefault(string)
Retrieves the local setting data associated with the specified setting's full name.
If the setting data is found, it is returned; otherwise, null is returned.
public static object GetLocalSettingOrDefault(string settingFullName)
Parameters
settingFullNamestringThe full name of the setting to retrieve.
Returns
- object
The local setting data associated with the setting, or
nullif no data is found.
Exceptions
- ArgumentNullException
Thrown if
settingFullNameis null or empty.
GetLocalSettingOrDefault(Type)
Retrieves the local setting data associated with the specified Type setting type.
If the setting data is found, it is returned; otherwise, null is returned.
public static object GetLocalSettingOrDefault(Type settingType)
Parameters
settingTypeTypeThe type of the setting to retrieve.
Returns
- object
The local setting data associated with the setting, or
nullif no data is found.
Exceptions
- ArgumentNullException
Thrown if
settingTypeis null.
GetLocalSettingOrDefault<T>()
Retrieves the local setting data associated with the specified T setting type.
If the setting data is found, it is returned; otherwise, null is returned.
public static T GetLocalSettingOrDefault<T>() where T : ISettings
Returns
- T
The local setting data associated with the setting, or
nullif no data is found.
Type Parameters
TThe type of the setting to retrieve. The type must implement ISettings.
Exceptions
- ArgumentNullException
Thrown if
Tis null.- InvalidCastException
Thrown if
Tis not actual type.
GetRegistrationMode(string)
Retrieves the registration mode associated with the specified setting's full name.
If the registration mode is found, it is returned; otherwise, null is returned.
public static RegistrationMode? GetRegistrationMode(string settingFullName)
Parameters
settingFullNamestringThe full name of the setting to retrieve the registration mode for.
Returns
- RegistrationMode?
A nullable RegistrationMode indicating the registration mode of the setting, or
nullif not found.
Exceptions
- ArgumentNullException
Thrown if
settingFullNameis null or empty.