/
GetSetting Method

GetSetting Method

Gets a Setting from the NodeSettings dictionary by setting name.

public Setting GetSetting(string name);

Classes: Settings


Parameters

value name

Setting name corresponding with the dictionary key inside of NodeSettings.

Returns

Setting

A setting object.


Example

The following example demonstrates getting a list setting and checking the type before accessing the appropriate value on the setting.

var setting = Settings.GetSetting("List Setting");
if (setting.Type != SettingType.List)
	throw new Exception("List setting had an unexpected type");
var list = setting.ListValue;

foreach (var value in list) 
{
	// ...
}

Remarks

Throws a KeyNotFoundException if no setting exists by the parameter name.

Related content

GetListSetting Method
GetListSetting Method
More like this
GetStringSetting Method
GetStringSetting Method
More like this
GetBooleanSetting Method
GetBooleanSetting Method
More like this
Setting Class
Setting Class
More like this
Settings Class
Settings Class
More like this
SettingType Enum
SettingType Enum
More like this