Interface IMenuHost
- Namespace
- RDCore.Forms.Menus
- Assembly
- RDCore.Forms.dll
A shown form's menus: what pops one of them up, the destination of VB's PopupMenu method.
public interface IMenuHost
Properties
Root
The form's root.
ComponentInstance Root { get; }
Property Value
Methods
PopupMenu(FormMenuItem, double?, double?, PopupMenuAlignment, FormMenuItem?)
Pops up the items of one of the form's menus, as VB's PopupMenu method does. The menu need not be visible on the bar: a
hidden top-level menu is the usual one. It raises its Click as it opens, as it does on the bar.
[SuppressMessage("Usage", "VSTHRD200:Use \"Async\" suffix for async methods", Justification = "VB's PopupMenu method, by its own name; hosts implement it as it is.")]
Task PopupMenu(FormMenuItem menu, double? x = null, double? y = null, PopupMenuAlignment alignment = PopupMenuAlignment.Left, FormMenuItem? boldItem = null)
Parameters
menuFormMenuItemThe menu whose items pop up.
xdouble?The point's horizontal coordinate in the root's scale, or null for the pointer's.
ydouble?The point's vertical coordinate in the root's scale, or null for the pointer's.
alignmentPopupMenuAlignmentWhere the menu goes across from the point.
boldItemFormMenuItemAn item of the menu to show in bold, as VB's
BoldCommandargument, or null.
Returns
- Task
A task that completes when the menu closes, after the Click of an item chosen from it. A menu that holds no items shows nothing, and the task returned has already completed.
Exceptions
- ArgumentNullException
menuis null.- ArgumentException
menuis not one of the form's menus.