Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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.

  • No labels