Table of Contents

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

ComponentInstance

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

menu FormMenuItem

The menu whose items pop up.

x double?

The point's horizontal coordinate in the root's scale, or null for the pointer's.

y double?

The point's vertical coordinate in the root's scale, or null for the pointer's.

alignment PopupMenuAlignment

Where the menu goes across from the point.

boldItem FormMenuItem

An item of the menu to show in bold, as VB's BoldCommand argument, 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

menu is null.

ArgumentException

menu is not one of the form's menus.