Table of Contents

Class MenuItem

Namespace
PluginUI
Assembly
PluginUI.dll

Menu entry used by context menus, drop-downs and menu buttons.

public sealed class MenuItem
Inheritance
MenuItem
Inherited Members

Constructors

MenuItem(string, Action?)

Creates an entry.

public MenuItem(string text, Action? action = null)

Parameters

text string
action Action

Properties

Action

Invoked when the entry is chosen.

[Browsable(false)]
public Action? Action { get; set; }

Property Value

Action

HasSubmenu

true if the entry opens a sub-menu.

public bool HasSubmenu { get; }

Property Value

bool

IsChecked

Shows a check mark.

public bool IsChecked { get; set; }

Property Value

bool

IsEnabled

Selectable when true.

public bool IsEnabled { get; set; }

Property Value

bool

IsSeparator

Separator entry.

public bool IsSeparator { get; }

Property Value

bool

Items

Sub-menu entries (non-empty = this entry opens a sub-menu).

public List<MenuItem> Items { get; }

Property Value

List<MenuItem>

ShortcutText

Shortcut hint displayed on the right (informative only).

public string? ShortcutText { get; set; }

Property Value

string

Tag

Free user data.

[Browsable(false)]
public object? Tag { get; set; }

Property Value

object

Text

Displayed text.

public string Text { get; set; }

Property Value

string

Methods

Separator()

A separator line.

public static MenuItem Separator()

Returns

MenuItem