PersistentSettings

References
A dictionary of SettingValue items.

Constructors

PersistentSettings

#
protected PersistentSettings()

Properties

ChildKeys

#Since v6.0
Gets a collection containing the keys in the settings dictionary.
public ICollection<string> ChildKeys { get; }

HiddenFromUserInterface

#Since v6.0
If false then values will appear in the EditOptions window
public bool HiddenFromUserInterface { get; set; }

Keys

#Since v6.0
Gets a collection containing the keys in the settings dictionary.
public ICollection<string> Keys { get; }

RhinoAppSettings

#Since v6.14
public static PersistentSettings RhinoAppSettings { get; }

StringListRootKey

#Since v5.0
Adding this string to a string list when calling SetStringList will cause the ProgramData setting to get inserted at that location in the list.
public static string StringListRootKey { get; }

Methods

AddChild

#Since v6.0
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.
public PersistentSettings AddChild(
key
Key to add to the child dictionary.
)
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.

ClearChangedFlag

#Since v6.0
public void ClearChangedFlag()

ContainsChangedValues

#Since v6.0
public bool ContainsChangedValues()

ContainsModifiedValues

#Since v5.0
public bool ContainsModifiedValues(
allUserSettings
)

DeleteChild

#Since v6.0
Call this method to delete a child settings key.
public void DeleteChild(
key
)

DeleteItem

#Since v5.0
public void DeleteItem(
key
)

FromPlugInId

#Since v5.0
public static PersistentSettings FromPlugInId(
pluginId
)

GetBool

#Since v6.0
public bool GetBool(
key,
defaultValue,
legacyKeyList
)

GetBool

#Since v5.0
public bool GetBool(
key,
defaultValue
)

GetBool

#Since v5.0
public bool GetBool(
key
)

GetByte

#Since v6.0
public byte GetByte(
key,
defaultValue,
legacyKeyList
)

GetByte

#Since v5.0
public byte GetByte(
key,
defaultValue
)

GetByte

#Since v5.0
public byte GetByte(
key
)

GetChar

#Since v6.0
public char GetChar(
key,
defaultValue,
legacyKeyList
)

GetChar

#Since v5.0
public char GetChar(
key,
defaultValue
)

GetChar

#Since v5.0
public char GetChar(
key
)

GetChild

#Since v6.0
Call this method to get a nested settings PersistentSettings instance, will throw a KeyNotFoundException exception if the key does not exist.
public PersistentSettings GetChild(
key
Key name
)
Returns persistent settings for the specified key or throws an exception if the key is invalid.
KeyNotFoundExceptionThrown if the key does not exist.

GetColor

#Since v6.0
public Color GetColor(
key,
defaultValue,
legacyKeyList
)

GetColor

#Since v5.0
public Color GetColor(
key,
defaultValue
)

GetColor

#Since v5.0
public Color GetColor(
key
)

GetColor

#
public Color? GetColor(
key,
defaultValue,
legacyKeyList
)

GetColor

#
public Color? GetColor(
key,
defaultValue
)

GetDate

#Since v6.0
public DateTime GetDate(
key,
defaultValue,
legacyKeyList
)

GetDate

#Since v5.0
public DateTime GetDate(
key,
defaultValue
)

GetDate

#Since v5.0
public DateTime GetDate(
key
)

GetDouble

#Since v6.0
public double GetDouble(
key,
defaultValue,
legacyKeyList
)

GetDouble

#Since v5.0
public double GetDouble(
key,
defaultValue
)

GetDouble

#Since v5.0
public double GetDouble(
key
)

GetEnumValue<T>

#Since v5.4
Gets a stored enumerated value using a custom key, or return default value if not found.
[CLSCompliant(false)] public T GetEnumValue<T>(
key,
T
defaultValue
)

GetEnumValue<T>

#Since v5.4
Get a stored enumerated value using a custom key.
[CLSCompliant(false)] public T GetEnumValue<T>(
key
)

GetEnumValue<T>

#Since v5.4
Get a stored enumerated value, or return default value if not found
[CLSCompliant(false)] public T GetEnumValue<T>(
T
defaultValue
)

GetGuid

#Since v6.0
public Guid GetGuid(
key,
defaultValue,
legacyKeyList
)

GetGuid

#Since v6.0
public Guid GetGuid(
key,
defaultValue
)

GetGuid

#Since v6.0
public Guid GetGuid(
key
)

GetInteger

#Since v6.0
public int GetInteger(
key,
defaultValue,
legacyKeyList
)

GetInteger

#Since v6.0
public int GetInteger(
key,
defaultValue,
bound,
boundIsLower
)

GetInteger

#Since v6.0
public int GetInteger(
key,
defaultValue,
lowerBound,
upperBound
)

GetInteger

#Since v5.0
public int GetInteger(
key,
defaultValue
)

GetInteger

#Since v5.0
public int GetInteger(
key
)

GetPoint

#Since v6.0
public Point GetPoint(
key,
defaultValue,
legacyKeyList
)

GetPoint

#Since v5.0
public Point GetPoint(
key,
defaultValue
)

GetPoint

#Since v5.0
public Point GetPoint(
key
)

GetPoint3d

#Since v6.0
public Point3d GetPoint3d(
key,
defaultValue,
legacyKeyList
)

GetPoint3d

#Since v5.0
public Point3d GetPoint3d(
key,
defaultValue
)

GetPoint3d

#Since v5.0
public Point3d GetPoint3d(
key
)

GetRectangle

#Since v6.0
public Rectangle GetRectangle(
key,
defaultValue,
legacyKeyList
)

GetRectangle

#Since v5.0
public Rectangle GetRectangle(
key,
defaultValue
)

GetRectangle

#Since v5.0
public Rectangle GetRectangle(
key
)

GetSettingIsHiddenFromUserInterface

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool GetSettingIsHiddenFromUserInterface(
key,
Key name for which to search.
legacyKeyList
)
Returns true if the setting is read-only otherwise false.
KeyNotFoundExceptionA KeyNotFoundException exception is thrown if the key is not found in the settings dictionary.

GetSettingIsHiddenFromUserInterface

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool GetSettingIsHiddenFromUserInterface(
key
Key name for which to search.
)
Returns true if the setting is read-only otherwise false.
KeyNotFoundExceptionA KeyNotFoundException exception is thrown if the key is not found in the settings dictionary.

GetSettingIsReadOnly

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool GetSettingIsReadOnly(
key
Key name for which to search.
)
Returns true if the setting is read-only otherwise false.
KeyNotFoundExceptionA KeyNotFoundException exception is thrown if the key is not found in the settings dictionary.

GetSettingType

#Since v6.0
Gets the type of the last value passed to Set... or Get... for the specified setting.
public Type GetSettingType(
key
Key name for which to search.
)
Type of the last value passed to Set... or Get... for the specified setting.
KeyNotFoundExceptionA KeyNotFoundException exception is thrown if the key is not found in the settings dictionary.

GetSize

#Since v6.0
public Size GetSize(
key,
defaultValue,
legacyKeyList
)

GetSize

#Since v5.0
public Size GetSize(
key,
defaultValue
)

GetSize

#Since v5.0
public Size GetSize(
key
)

GetString

#Since v6.0
public string GetString(
key,
defaultValue,
legacyKeyList
)

GetString

#Since v5.0
public string GetString(
key,
defaultValue
)

GetString

#Since v5.0
public string GetString(
key
)

GetStringDictionary

#
public KeyValuePair<string, string>[] GetStringDictionary(
key,
defaultValue,
legacyKeyList
)

GetStringDictionary

#
public KeyValuePair<string, string>[] GetStringDictionary(
key,
defaultValue
)

GetStringDictionary

#Since v6.0
public KeyValuePair<string, string>[] GetStringDictionary(
key
)

GetStringList

#Since v6.0
public string[] GetStringList(
key,
defaultValue,
legacyKeyList
)

GetStringList

#Since v5.0
public string[] GetStringList(
key,
defaultValue
)

GetStringList

#Since v5.0
public string[] GetStringList(
key
)

GetUnsignedInteger

#Since v6.0
[CLSCompliant(false)] public uint GetUnsignedInteger(
key,
defaultValue,
legacyKeyList
)

GetUnsignedInteger

#Since v5.0
[CLSCompliant(false)] public uint GetUnsignedInteger(
key,
defaultValue
)

GetUnsignedInteger

#Since v5.0
[CLSCompliant(false)] public uint GetUnsignedInteger(
key
)

GetValidator<T>

#Since v5.0
Provides a way to find a ready-to-use validator for the PersistentSetting class for the given the key, or obtaining null.
public EventHandler<PersistentSettingsEventArgs<T>> GetValidator<T>(
key
The name of the setting key.
)
A valid validator, or null if no validator was found.
InvalidCastExceptionIf type parameter T is not the right specialization for PersistentSettingsEventArgs<T>.

HideSettingFromUserInterface

#Since v6.0
public void HideSettingFromUserInterface(
key
)

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.
)

SetBool

#Since v5.0
public void SetBool(
key,
value
)

SetByte

#Since v5.0
public void SetByte(
key,
value
)

SetChar

#Since v5.0
public void SetChar(
key,
value
)

SetColor

#Since v5.0
public void SetColor(
key,
value
)

SetColor

#
public void SetColor(
key,
value
)

SetDate

#Since v5.0
public void SetDate(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v6.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#
public void SetDefault()

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDefault

#Since v5.0
public void SetDefault(
key,
value
)

SetDouble

#Since v5.0
public void SetDouble(
key,
value
)

SetEnumValue<T>

#Since v5.4
Set an enumerated value in the settings using a custom key
[CLSCompliant(false)] public void SetEnumValue<T>(
key,
T
value
)

SetEnumValue<T>

#Since v5.4
Set an enumerated value in the settings.
[CLSCompliant(false)] public void SetEnumValue<T>(
T
enumValue
)

SetGuid

#Since v6.0
public void SetGuid(
key,
value
)

SetInteger

#Since v5.0
public void SetInteger(
key,
value
)

SetPoint

#Since v5.0
public void SetPoint(
key,
value
)

SetPoint3d

#Since v5.0
public void SetPoint3d(
key,
value
)

SetRectangle

#Since v5.0
public void SetRectangle(
key,
value
)

SetSize

#Since v5.0
public void SetSize(
key,
value
)

SetString

#Since v5.0
public void SetString(
key,
value
)

SetStringDictionary

#
public void SetStringDictionary()

SetStringList

#Since v5.0
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.
public void SetStringList(
key,
The string key.
value
An array of values to set.
)

SetUnsignedInteger

#Since v5.0
[CLSCompliant(false)] public void SetUnsignedInteger(
key,
value
)
Explicit

ISerializable.GetObjectData

#
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] void ISerializable.GetObjectData()

TryGetBool

#Since v6.0
public bool TryGetBool(
key,
out bool
value,
legacyKeyList
)

TryGetBool

#Since v5.0
public bool TryGetBool(
key,
out bool
value
)

TryGetByte

#Since v6.0
public bool TryGetByte(
key,
out byte
value,
legacyKeyList
)

TryGetByte

#Since v5.0
public bool TryGetByte(
key,
out byte
value
)

TryGetChar

#Since v6.0
public bool TryGetChar(
key,
out char
value,
legacyKeyList
)

TryGetChar

#Since v5.0
public bool TryGetChar(
key,
out char
value
)

TryGetChild

#Since v6.0
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 true if the key exists and value was set otherwise; returns false.

TryGetColor

#Since v6.0
public bool TryGetColor(
key,
out Color
value,
legacyKeyList
)

TryGetColor

#Since v5.0
public bool TryGetColor(
key,
out Color
value
)

TryGetColor

#
public bool TryGetColor(
key,
out Color?
value,
legacyKeyList
)

TryGetColor

#
public bool TryGetColor(
key,
out Color?
value
)

TryGetDate

#Since v6.0
public bool TryGetDate(
key,
value,
legacyKeyList
)

TryGetDate

#Since v5.0
public bool TryGetDate(
key,
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out bool
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out byte
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out char
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out Color
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out double
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out int
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out Point3d
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out Size
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out string
value
)

TryGetDefault

#Since v5.0
public bool TryGetDefault(
key,
out string[]
value
)

TryGetDouble

#Since v6.0
public bool TryGetDouble(
key,
out double
value,
legacyKeyList
)

TryGetDouble

#Since v5.0
public bool TryGetDouble(
key,
out double
value
)

TryGetEnumValue<T>

#Since v5.4
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.
[CLSCompliant(false)] public bool TryGetEnumValue<T>(
key,
out T
enumValue
)
true if successful

TryGetGuid

#Since v6.0
public bool TryGetGuid(
key,
out Guid
value,
legacyKeyList
)

TryGetGuid

#Since v6.0
public bool TryGetGuid(
key,
out Guid
value
)

TryGetInteger

#Since v6.0
public bool TryGetInteger(
key,
out int
value,
legacyKeyList
)

TryGetInteger

#Since v5.0
public bool TryGetInteger(
key,
out int
value
)

TryGetPoint

#Since v6.0
public bool TryGetPoint(
key,
out Point
value,
legacyKeyList
)

TryGetPoint

#Since v5.0
public bool TryGetPoint(
key,
out Point
value
)

TryGetPoint3d

#Since v6.0
public bool TryGetPoint3d(
key,
out Point3d
value,
legacyKeyList
)

TryGetPoint3d

#Since v5.0
public bool TryGetPoint3d(
key,
out Point3d
value
)

TryGetRectangle

#Since v6.0
public bool TryGetRectangle(
key,
value,
legacyKeyList
)

TryGetRectangle

#Since v5.0
public bool TryGetRectangle(
key,
value
)

TryGetSettingIsHiddenFromUserInterface

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool TryGetSettingIsHiddenFromUserInterface(
key,
Key name for which to search.
out bool
value,
Value will be true if the setting is read-only otherwise false. setting.
legacyKeyList
)

TryGetSettingIsHiddenFromUserInterface

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool TryGetSettingIsHiddenFromUserInterface(
key,
Key name for which to search.
out bool
value
Value will be true if the setting is read-only otherwise false. setting.
)

TryGetSettingIsReadOnly

#Since v6.0
Values read from all users settings files will be marked as read-only which will cause any future calls to Set... to fail.
public bool TryGetSettingIsReadOnly(
key,
Key name for which to search.
out bool
value
Value will be true if the setting is read-only otherwise false. setting.
)

TryGetSettingType

#Since v6.0
Get the type of the last value passed to Set... or Get... for the specified setting.
public bool TryGetSettingType(
key,
Key name for which to search.
out Type
type
Type of the last value passed to Set... or Get... for the specified setting.
)

TryGetSize

#Since v6.0
public bool TryGetSize(
key,
out Size
value,
legacyKeyList
)

TryGetSize

#Since v5.0
public bool TryGetSize(
key,
out Size
value
)

TryGetString

#Since v6.0
public bool TryGetString(
key,
out string
value,
legacyKeyList
)

TryGetString

#Since v5.0
public bool TryGetString(
key,
out string
value
)

TryGetStringDictionary

#
public bool TryGetStringDictionary(
key,
value,
legacyKeyList
)

TryGetStringDictionary

#
public bool TryGetStringDictionary(
key,
value
)

TryGetStringList

#Since v6.0
public bool TryGetStringList(
key,
out string[]
value,
legacyKeyList
)

TryGetStringList

#Since v5.0
public bool TryGetStringList(
key,
out string[]
value
)

TryGetUnsignedInteger

#Since v6.0
[CLSCompliant(false)] public bool TryGetUnsignedInteger(
key,
out uint
value,
legacyKeyList
)

TryGetUnsignedInteger

#Since v5.0
[CLSCompliant(false)] public bool TryGetUnsignedInteger(
key,
out uint
value
)