Table of Contents

Constructor CadPluginMenuItem

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

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

text string

The text.

run Action<CadPluginContext>

The callback, run at once on the window's thread.

isEnabled bool

Whether the item can be chosen.

isChecked bool?

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

text string

The text.

items IReadOnlyList<CadPluginMenuItem>

The items of the submenu, in order; none of them null.

isEnabled bool

Whether the submenu can be opened.

isChecked bool?

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.