Table of Contents

Class FormMenu

Namespace
RDCore.Forms.Menus
Assembly
RDCore.Forms.dll

A form's menus: the RDForms.Menu components its root holds, as the items of its menu bar, each holding the items of its own menu.

public sealed class FormMenu
Inheritance
FormMenu
Inherited Members

Remarks

The items are the components themselves, read as the root holds them each time they are asked for. A component's values are its FormMenuItem's, so a change to one shows in the other.

Properties

AllItems

Every item of the form, each menu before its own items.

public IEnumerable<FormMenuItem> AllItems { get; }

Property Value

IEnumerable<FormMenuItem>

Arrays

The form's menu arrays: one for each name its indexed items have, in the order of their first item.

public IReadOnlyList<FormMenuArray> Arrays { get; }

Property Value

IReadOnlyList<FormMenuArray>

Items

The items of the menu bar: the root's menus, in the order it holds them.

public IReadOnlyList<FormMenuItem> Items { get; }

Property Value

IReadOnlyList<FormMenuItem>

Root

The form's root.

public ComponentInstance Root { get; }

Property Value

ComponentInstance

ShowsTheBar

Whether the form shows a menu bar: one of its items is visible. A form whose menus are all hidden, as one that keeps them only to pop up, shows none.

public bool ShowsTheBar { get; }

Property Value

bool

Methods

ArrayOf(string)

The menu array whose items have a name, compared without regard to case.

public FormMenuArray? ArrayOf(string name)

Parameters

name string

The array's name.

Returns

FormMenuArray

The array, the same object each time for the same name; null where no item of that name has an index.

Exceptions

ArgumentNullException

name is null.

IsLoadedAtRunTime(FormMenuItem)

Whether an item is an element a program loaded with Load(int), and has not unloaded.

public bool IsLoadedAtRunTime(FormMenuItem item)

Parameters

item FormMenuItem

The item.

Returns

bool

true for an element loaded at run time; false for one of the form's file.

Exceptions

ArgumentNullException

item is null.

Of(ComponentInstance)

Gets the menus of a form.

public static FormMenu Of(ComponentInstance root)

Parameters

root ComponentInstance

The form's root.

Returns

FormMenu

The form's menus: the same object each time for the same root.

Exceptions

ArgumentNullException

root is null.

ArgumentException

root is not a designer root.

Events

ItemLoaded

Raised after Load(int) places an element in its menu, or on the bar.

public event EventHandler<FormMenuItemEventArgs>? ItemLoaded

Event Type

EventHandler<FormMenuItemEventArgs>

ItemUnloaded

Raised after Unload(int) takes an element out of its menu, or off the bar.

public event EventHandler<FormMenuItemEventArgs>? ItemUnloaded

Event Type

EventHandler<FormMenuItemEventArgs>