Constructor CadPluginMenuItem
CadPluginMenuItem(string, Action<CadPluginContext>, bool, bool?)
Makes an item that runs a callback.
public CadPluginMenuItem(string text, Action<CadPluginContext> run, bool isEnabled = true, bool? isChecked = null)
Parameters
textstringThe text.
runAction<CadPluginContext>The callback, run at once on the window's thread.
isEnabledboolWhether the item can be chosen.
isCheckedbool?Null for no tick; true for a ticked item; false for a tick box not ticked.
Exceptions
- ArgumentNullException
Thrown when the text or the callback is null.
CadPluginMenuItem(string, IReadOnlyList<CadPluginMenuItem>, bool, bool?)
Makes an item that opens a submenu.
public CadPluginMenuItem(string text, IReadOnlyList<CadPluginMenuItem> items, bool isEnabled = true, bool? isChecked = null)
Parameters
textstringThe text.
itemsIReadOnlyList<CadPluginMenuItem>The items of the submenu, in order; none of them null.
isEnabledboolWhether the submenu can be opened.
isCheckedbool?Null for no tick; true for a ticked item; false for a tick box not ticked.
Exceptions
- ArgumentNullException
Thrown when the text or the items are null.
- ArgumentException
Thrown when an item is null.