GH_SettingsServer

References
public sealed class GH_SettingsServer : GH_ISerializable
A single instance of this class is maintained at module level under the accessor "Settings".

Constructors

GH_SettingsServer

#
Create a new instance of the GH_SettingsServer class. The server will be associated with a settings xml file in the %ApplicationData%\Grasshopper\ directory.
public GH_SettingsServer(
databaseName,
The name of the settings server (equals the name of the xml file so it must adhere to FAT, FAT32 and NTFS naming conventions).
loadSettings
When true and a file with the same name already exists, its settings will be automatically loaded.
)

GH_SettingsServer

#
Create a new instance of the GH_SettingsServer class. The server will be associated with a settings xml file in the %ApplicationData%\Grasshopper\ directory. If a file with the same name already exists, its settings will be automatically loaded.
public GH_SettingsServer(
databaseName
The name of the settings server (equals the name of the xml file so it must adhere to FAT, FAT32 and NTFS naming conventions).
)

Properties

Count

#
Gets the total number of settings stored in this database.
public int Count { get; }

DatabaseName

#
Gets the name of this settings database.
public string DatabaseName { get; }

Methods

Clear

#
Destroy all settings.
public void Clear()

ConstainsEntry

#
Tests to see if a given entry is stored in this settings database.
public bool ConstainsEntry(
name
Entry name to query.
)
True if the entry exists, false otherwise.

DeleteValue

#
public void DeleteValue(
key
)

EntryNames

#
Gets a list of all the entry names in this settings.
public List<string> EntryNames()

EntryType

#
Gets the type of a specific entry.
public GH_SettingsType EntryType(
name
Name of entry.
)
Type of entry. If entry doesn't exist, GH_SettingsType._unknown is returned.

GetValue

#
public bool GetValue(
key,
default
)

GetValue

#
public byte GetValue(
key,
default
)

GetValue

#
public Color GetValue(
key,
Color
default
)

GetValue

#
public DateTime GetValue(
key,
default
)

GetValue

#
public double GetValue(
key,
default
)

GetValue

#
public int GetValue(
key,
default
)

GetValue

#
public Point GetValue(
key,
Point
default
)

GetValue

#
public Rectangle GetValue(
key,
Rectangle
default
)

GetValue

#
public Size GetValue(
key,
Size
default
)

GetValue

#
public string GetValue(
key,
default
)

Read

#
Low-level deserializer.
public bool Read(
reader
Object to read from.
)
True on success, false on failure.
Read

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key,
Color
value
)

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key,
Point
value
)

SetValue

#
public void SetValue(
key,
Rectangle
value
)

SetValue

#
public void SetValue(
key,
Size
value
)

SetValue

#
public void SetValue(
key,
value
)

SetValue

#
public void SetValue(
key
)

Write

#
Low-level serializer.
public bool Write(
writer
Object to write with. Writer must represent an empty archive chunk.
)
True on success, false on failure.
Write

WritePersistentSettings

#
Store all settings in the xml file now. You must call this function if you want the current settings to persist between sessions.
public void WritePersistentSettings()