Constructors
PersistentSettings
#Properties
Gets a collection containing the keys in the settings dictionary.
Gets a collection containing the keys in the settings dictionary.
Methods
Call this method to add a new child key, if the key is exists then the existing key is returned otherwise a new empty PersistentSettings child key is added and the new settings are returned.
Returns: If the key is exists then the existing key is returned otherwise a new empty PersistentSettings child key is added and the new settings are returned.
public void ClearChangedFlag()
Call this method to delete a child settings key.
Call this method to get a nested settings PersistentSettings instance, will throw a KeyNotFoundException exception if the key does not exist.
Returns: Returns persistent settings for the specified key or throws an exception if the key is invalid.
Exceptions:
| KeyNotFoundException | Thrown if the key does not exist. |
Gets a stored enumerated value using a custom key, or return default value if not found.
Get a stored enumerated value, or return default value if not found
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
Returns: Returns true if the setting is read-only otherwise false.
Exceptions:
| KeyNotFoundException | A KeyNotFoundException exception is thrown if the key is not found in the settings dictionary. |
Gets the type of the last value passed to Set... or Get... for the specified setting.
Returns: Type of the last value passed to Set... or Get... for the specified setting.
Exceptions:
| KeyNotFoundException | A KeyNotFoundException exception is thrown if the key is not found in the settings dictionary. |
GetStringDictionary
#GetStringDictionary
#Provides a way to find a ready-to-use validator for the PersistentSetting class for the given the key, or obtaining null.
Returns: A valid validator, or null if no validator was found.
Exceptions:
| InvalidCastException | If type parameter T is not the right specialization for PersistentSettingsEventArgs<T>. |
RegisterSettingsValidator<T>
#Sets a validator for a given key.
Note to implementers: T should be one of the supported types for the PersistentSettings class and should match the type associated with the key.
This method allows to use anonymous methods and lambda expressions.
public void RegisterSettingsValidator<T>()
key,
The key to which to bind the validator.
validator
A validator instance of your own class.
SetDefault
#Set an enumerated value in the settings using a custom key
Set an enumerated value in the settings.
SetStringDictionary
#Including a item with the value of StringListRootKey will cause the ProgramData value to get inserted at that location in the list when calling GetStringList.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData()
Call this method to get a nested settings PersistentSettings instance, will return true if the key exists and value was set otherwise; will return false and value will be set to null.
public bool TryGetChild()
key,
[in] Key name
value
[out] Will be set the child settings if the key is valid otherwise it will be null.
Returns: Returns true if the key exists and value was set otherwise; returns false.
Attempt to get the stored value for an enumerated setting using a custom key. Note: the enumerated value ALWAYS gets assigned! Be sure to check for success of this method to prevent erroneous use of the value.
Returns: true if successful
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
Get the type of the last value passed to Set... or Get... for the specified setting.