PersistentSettings
ReferencesA dictionary of SettingValue items.
Constructors
PersistentSettings
#Parameters:
| info (SerializationInfo) | |
| context (StreamingContext) |
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.
Parameters:
| key (string) | Key to add to the child dictionary. |
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()
Parameters:
| allUserSettings (PersistentSettings) |
Call this method to delete a child settings key.
Parameters:
| key (string) |
Parameters:
| pluginId (Guid) |
Parameters:
| key (string) | |
| defaultValue (bool) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (byte) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (char) | |
| legacyKeyList (IEnumerable<string>) |
Call this method to get a nested settings PersistentSettings instance, will throw a KeyNotFoundException exception if the key does not exist.
Parameters:
| key (string) | Key name |
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. |
Parameters:
| key (string) | |
| defaultValue (Color) | |
| legacyKeyList (IEnumerable<string>) |
GetColor
#Parameters:
| key (string) | |
| defaultValue (Color?) | |
| legacyKeyList (IEnumerable<string>) |
GetColor
#Parameters:
| key (string) | |
| defaultValue (DateTime) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (double) | |
| legacyKeyList (IEnumerable<string>) |
Gets a stored enumerated value using a custom key, or return default value if not found.
Parameters:
| key (string) | |
| defaultValue (T) |
Get a stored enumerated value using a custom key.
Parameters:
| key (string) |
Exceptions:
| KeyNotFoundException |
Get a stored enumerated value, or return default value if not found
Parameters:
| defaultValue (T) |
Parameters:
| key (string) | |
| defaultValue (Guid) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (int) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (Point) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (Point3d) | |
| legacyKeyList (IEnumerable<string>) |
public Rectangle GetRectangle(string key, Rectangle defaultValue, IEnumerable<string> legacyKeyList)
Parameters:
| key (string) | |
| defaultValue (Rectangle) | |
| legacyKeyList (IEnumerable<string>) |
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
Parameters:
| key (string) | Key name for which to search. |
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.
Parameters:
| key (string) | Key name for which to search. |
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. |
Parameters:
| key (string) | |
| defaultValue (Size) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| defaultValue (string) | |
| legacyKeyList (IEnumerable<string>) |
GetStringDictionary
#public KeyValuePair<string, string>[] GetStringDictionary(string key, KeyValuePair<string, string>[] defaultValue, IEnumerable<string> legacyKeyList)
Parameters:
| key (string) | |
| defaultValue (KeyValuePair<string, string>[]) | |
| legacyKeyList (IEnumerable<string>) |
GetStringDictionary
#public KeyValuePair<string, string>[] GetStringDictionary(string key, KeyValuePair<string, string>[] defaultValue)
Parameters:
| key (string) | |
| defaultValue (KeyValuePair<string, string>[]) |
Parameters:
| key (string) |
Parameters:
| key (string) | |
| defaultValue (string[]) | |
| legacyKeyList (IEnumerable<string>) |
[CLSCompliant(false)]
public uint GetUnsignedInteger(string key, uint defaultValue, IEnumerable<string> legacyKeyList)
Parameters:
| key (string) | |
| defaultValue (uint) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) |
Provides a way to find a ready-to-use validator for the PersistentSetting class for the given the key, or obtaining null.
Parameters:
| key (string) | The name of the setting key. |
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>. |
Parameters:
| key (string) |
RegisterSettingsValidator<T>
#public void RegisterSettingsValidator<T>(string key, EventHandler<PersistentSettingsEventArgs<T>> validator)
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.
Parameters:
| key (string) | The key to which to bind the validator. |
| validator (EventHandler<PersistentSettingsEventArgs<T>>) | A validator instance of your own class. |
SetDefault
#Parameters:
| key (string) | |
| value (KeyValuePair<string, string>[]) |
Set an enumerated value in the settings using a custom key
Parameters:
| key (string) | |
| value (T) |
Set an enumerated value in the settings.
Parameters:
| enumValue (T) |
SetStringDictionary
#Parameters:
| key (string) | |
| value (KeyValuePair<string, string>[]) |
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(SerializationInfo info, StreamingContext context)
Parameters:
| info (SerializationInfo) | |
| context (StreamingContext) |
Parameters:
| key (string) | |
| value (out bool) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out byte) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out char) | |
| legacyKeyList (IEnumerable<string>) |
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.
Parameters:
| key (string) | [in] Key name |
| value (out PersistentSettings) | [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.
Parameters:
| key (string) | |
| value (out Color) | |
| legacyKeyList (IEnumerable<string>) |
TryGetColor
#Parameters:
| key (string) | |
| value (out Color?) | |
| legacyKeyList (IEnumerable<string>) |
TryGetColor
#Parameters:
| key (string) | |
| value (out DateTime) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out double) | |
| legacyKeyList (IEnumerable<string>) |
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.
Parameters:
| key (string) | |
| enumValue (out T) |
Returns: true if successful
Parameters:
| key (string) | |
| value (out Guid) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out int) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out Point) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out Point3d) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out Rectangle) | |
| legacyKeyList (IEnumerable<string>) |
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.
Parameters:
| key (string) | |
| value (out Size) | |
| legacyKeyList (IEnumerable<string>) |
Parameters:
| key (string) | |
| value (out string) | |
| legacyKeyList (IEnumerable<string>) |
TryGetStringDictionary
#public bool TryGetStringDictionary(string key, out KeyValuePair<string, string>[] value, IEnumerable<string> legacyKeyList)
Parameters:
| key (string) | |
| value (out KeyValuePair<string, string>[]) | |
| legacyKeyList (IEnumerable<string>) |
TryGetStringDictionary
#Parameters:
| key (string) | |
| value (out KeyValuePair<string, string>[]) |
Parameters:
| key (string) | |
| value (out string[]) | |
| legacyKeyList (IEnumerable<string>) |
[CLSCompliant(false)]
public bool TryGetUnsignedInteger(string key, out uint value, IEnumerable<string> legacyKeyList)
Parameters:
| key (string) | |
| value (out uint) | |
| legacyKeyList (IEnumerable<string>) |