GH_NumberPresets

References
public class GH_NumberPresets
Maintains a collection of presets for use in numeric GUI.

Properties

Count

#
public int Count { get; }
Gets the number of presets stored in this class.

Methods

AddPreset

#
public void AddPreset(string name, decimal value, string description)
Add a new preset to the collection.
name (string)Name of preset.
value (decimal)Value of preset.
description (string)Description of preset.

AddPreset

#
public void AddPreset(string name, decimal value)
Add a new preset to the collection.
name (string)Name of preset.
value (decimal)Value of preset.

AddPreset

#
public void AddPreset(string name, double value, string description)
Add a new preset to the collection.
name (string)Name of preset.
value (double)Value of preset.
description (string)Description of preset.

AddPreset

#
public void AddPreset(string name, double value)
Add a new preset to the collection.
name (string)Name of preset.
value (double)Value of preset.

PopulateMenu

#
public void PopulateMenu(ToolStrip menu, decimal current, EventHandler clickDelegate)
Populate a menu with the presets. Preset values will be stored as Decimals in the Tag of the menu items.
menu (ToolStrip)Menu to append to.
current (decimal)Current value (will be checked)
clickDelegate (EventHandler)Event handler for all menu items.

PopulateMenu

#
public void PopulateMenu(ToolStrip menu, decimal current, string format, EventHandler clickDelegate)
Populate a menu with the presets. Preset values will be stored as Decimals in the Tag of the menu items.
menu (ToolStrip)Menu to append to.
current (decimal)Current value (will be checked)
format (string)String format for menu item text. The Name field will be stored under {0} and the value field under {1}.
clickDelegate (EventHandler)Event handler for all menu items.

PresetDescription

#
public string PresetDescription(int index)
Gets the preset description at the given index.
index (int)Index of preset to retrieve.
Description of preset.

PresetName

#
public string PresetName(int index)
Gets the preset name at the given index.
index (int)Index of preset to retrieve.
Name of preset.

PresetValue

#
public decimal PresetValue(int index)
Gets the preset at the given index.
index (int)Index of preset to retrieve.
Value of preset.