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
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
Items
The items of the menu bar: the root's menus, in the order it holds them.
public IReadOnlyList<FormMenuItem> Items { get; }
Property Value
Root
The form's root.
public ComponentInstance Root { get; }
Property Value
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
Methods
ArrayOf(string)
The menu array whose items have a name, compared without regard to case.
public FormMenuArray? ArrayOf(string name)
Parameters
namestringThe 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
nameis 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
itemFormMenuItemThe item.
Returns
Exceptions
- ArgumentNullException
itemis null.
Of(ComponentInstance)
Gets the menus of a form.
public static FormMenu Of(ComponentInstance root)
Parameters
rootComponentInstanceThe form's root.
Returns
- FormMenu
The form's menus: the same object each time for the same root.
Exceptions
- ArgumentNullException
rootis null.- ArgumentException
rootis 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
ItemUnloaded
Raised after Unload(int) takes an element out of its menu, or off the bar.
public event EventHandler<FormMenuItemEventArgs>? ItemUnloaded