Skip to main content
Version: 4.1

ContextMenu

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a context menu associated to a Control.

public class ContextMenu : Menu

Constructors

Instance member ContextMenu()

Initializes a new instance of the ContextMenu class with no menu items specified.

Instance member ContextMenu(menuItems)

Initializes a new instance of the ContextMenu class with a specified set of MenuItem objects.

NameTypeDescription
menuItemsMenuItem[]An array of MenuItem objects that represent the menu items to add to the shortcut menu.

Instance member ContextMenu(container)

Initializes a new instance of the ToolTip class with a specified container.

NameTypeDescription
containerIContainerAn IContainer that represents the container of the ToolTip extender.

Properties

Instance member RightToLeft

RightToLeft: Returns or sets whether the text displayed by the control is displayed from right to left.

Instance member SourceComponent

IWisejComponent: Returns the component that is displaying the shortcut menu.

Instance member SourceControl

Control: Returns the control that is displaying the shortcut menu.

Methods

Protected member Dispose(disposing)

Disposes of the resources, other than memory, used by the ContextMenu.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Protected member OnCollapse(e)

Fires the Collapse event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnLoad(e)

Fires the Load event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnMenuItemAdded(e)

Fires the MenuItemAdded event.

ParameterTypeDescription
eMenuItemEventArgsA MenuItemEventArgs that contains the event data.

Protected member OnMenuItemRemoved(e)

Fires the MenuItemRemoved event.

ParameterTypeDescription
eMenuItemEventArgsA MenuItemEventArgs that contains the event data.

Protected member OnPopup(e)

Fires the Popup event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member Show(component, position, onclose)

Displays the context menu at the specified position in relation to the specified component.

ParameterTypeDescription
componentIWisejComponentCan be any Wisej visual component: i.e. tool button, column header, etc.
positionPlacementA Placement that specifies position of the menu in relation to the component parameter.
onclose optionalAction<ContextMenu>Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.

Instance member Show(pos, onclose)

Displays the context menu at the specified position.

ParameterTypeDescription
posPointA Point that specifies the coordinates at which to display the menu.
onclose optionalAction<ContextMenu>Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.

Instance member Show(control, position, onclose)

Displays the context menu at the specified position in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
positionPlacementA Placement that specifies position of the menu in relation to the control parameter.
onclose optionalAction<ContextMenu>Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.

Throws:

Instance member Show(control, pos, onclose)

Displays the context menu at the specified position in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
posPointA Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
onclose optionalAction<ContextMenu>Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.

Throws:

Instance member Show(control, pos, alignment, onclose)

Displays the context menu at the specified position and with the specified alignment in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
posPointA Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
alignmentLeftRightAlignmentA LeftRightAlignment that specifies the alignment of the control relative to the pos parameter.
onclose optionalAction<ContextMenu>Optional async handler for the close event; called when the context menu has been closed. It's the equivalent of handling the event.

Throws:

Instance member ShowAsync(component, position)

Asynchronously displays the context menu at the specified position in relation to the specified component.

ParameterTypeDescription
componentIWisejComponentCan be any Wisej visual component: i.e. tool button, column header, etc.
positionPlacementA Placement that specifies position of the menu in relation to the component parameter.

Returns: Task.

Instance member ShowAsync(pos)

Asynchronously displays the context menu at the specified position.

ParameterTypeDescription
posPointA Point that specifies the coordinates at which to display the menu.

Returns: Task.

Instance member ShowAsync(control, position)

Asynchronously displays the context menu at the specified position in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
positionPlacementA Placement that specifies position of the menu in relation to the control parameter.

Returns: Task.

Throws:

Instance member ShowAsync(control, pos)

Asynchronously displays the context menu at the specified position in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
posPointA Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.

Returns: Task.

Throws:

Instance member ShowAsync(control, pos, alignment)

Asynchronously displays the context menu at the specified position and with the specified alignment in relation to the specified control.

ParameterTypeDescription
controlControlA Control that specifies the control with which this shortcut menu is associated.
posPointA Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.
alignmentLeftRightAlignmentA LeftRightAlignment that specifies the alignment of the control relative to the pos parameter.

Returns: Task.

Throws:

Instance member Update()

Updates the component on the client. Overridden to update the owner control.

Events

Instance member Collapse

EventHandler Fired when the context menu collapses.

Instance member Load

EventHandler Occurs before the context menu is displayed on the client when shown using one of the Show or ShowAsync methods. It doesn't fire when the context menu is associated to a control and it's shown from a user event (i.e. the user right clicks on the control associated with the context menu).

EventHandler Occurs after the context menu is displayed on the client.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejSerializableAllows an object to serialize itself.