Class SettingsExtensions
- Namespace
- OpenSettings.Extensions
- Assembly
- OpenSettings.dll
Provides extension methods for ISettings.
public static class SettingsExtensions
- Inheritance
-
SettingsExtensions
- Inherited Members
Methods
GetLocalSettingOrDefault(ISettings)
Gets the local setting data associated with the specified ISettings object.
If local setting data is found, it is returned; otherwise, null is returned.
public static object GetLocalSettingOrDefault(this ISettings setting)
Parameters
settingISettingsThe settings object for which the local setting data is to be retrieved.
Returns
- object
The local setting data associated with the setting object, or
nullif no data is found.
Exceptions
- NullReferenceException
Thrown if
settingis null.
GetLocalSettingOrDefault<T>(ISettings)
Gets the local setting data associated with the specified ISettings object,
cast to the specified type T.
If local setting data is found, it is returned; otherwise, null is returned.
public static T GetLocalSettingOrDefault<T>(this ISettings setting) where T : ISettings
Parameters
settingISettingsThe settings object for which the local setting data is to be retrieved.
Returns
- T
The local setting data associated with the setting object, cast to type
T, ornullif no data is found.
Type Parameters
TThe type to which the local setting data should be cast. The type must implement ISettings.
Exceptions
- NullReferenceException
Thrown if
settingis null.
GetRegistrationMode(ISettings)
Gets the registration mode associated with the specified ISettings object.
If the registration mode is found, it is returned; otherwise, null is returned.
public static RegistrationMode? GetRegistrationMode(this ISettings setting)
Parameters
settingISettingsThe settings object for which the registration mode is to be retrieved.
Returns
- RegistrationMode?
A nullable RegistrationMode indicating the registration mode of the setting, or
nullif not found.
Exceptions
- NullReferenceException
Thrown if
settingis null.