New to Telerik UI for WinForms? Start a free 30-day trial

Provides methods for displaying a context menu for a document or tool window.

Definition

Constructors

Creates a context-menu service with document, tool-window, and active-window-list menus enabled.

C#
public ContextMenuService()

Fields

Identifies the command that activates and reveals the associated dock window.

C#
public const string ActivateWindow = "ActivateWindow"

Identifies the command that closes all windows in the document container.

C#
public const string CloseAll = "CloseAll"

Identifies the command that closes unpinned windows in the document container.

C#
public const string CloseAllButPinned = "CloseAllButPinned"

Identifies the command that closes every document window except the associated one.

C#
public const string CloseAllButThis = "CloseAllButThis"

Identifies the command that closes the associated document window.

C#
public const string CloseWindow = "CloseWindow"

Identifies the command that changes the associated window to the auto-hide state.

C#
public const string DockStateAutoHide = "AutoHide"

Identifies the command that changes the associated window to the docked state.

C#
public const string DockStateDocked = "Docked"

Identifies the command that changes the associated window to the floating state.

C#
public const string DockStateFloating = "Floating"

Identifies the command that hides the associated window.

C#
public const string DockStateHidden = "Hidden"

Identifies the command that changes the associated window to the tabbed-document state.

C#
public const string DockStateTabbedDocument = "TabbedDocument"

Identifies the command that moves the associated document to the next tab group.

C#
public const string MoveToNextTabGroup = "MoveToNextTabGroup"

Identifies the command that moves the associated document to the previous tab group.

C#
public const string MoveToPrevTabGroup = "MoveToPrevTabGroup"

Identifies the command that places the associated document in a horizontal tab group.

C#
public const string NewHTabGroup = "NewHTabGroup"

Identifies the command that places the associated document in a vertical tab group.

C#
public const string NewVTabGroup = "NewVTabGroup"

Properties

Determines whether a context menu, listing all opened documents within a document strip, may be displayed.

C#
public bool AllowActiveWindowListContextMenu { get; set; }

Determines whether context menus, associated with a document window may be displayed.

C#
public bool AllowDocumentContextMenu { get; set; }

Determines whether context menus, associated with a tool window may be displayed.

C#
public bool AllowToolContextMenu { get; set; }

Gets the currently displayed menu.

C#
[Browsable(false)]
public RadContextMenu DisplayedMenu { get; }

Determines whether a context menu is currently displayed.

C#
[Browsable(false)]
public bool IsMenuDisplayed { get; }

Methods

Determines whether a context menu can be displayed for the specified window.

C#
protected virtual bool CanDisplayMenu(DockWindow window)
Parameters:windowDockWindowReturns:

bool

Displays a context menu, listing all currently active documents within the specified document strip.

C#
public void DisplayActiveWindowList(DocumentTabStrip strip, Point screenPos)
Parameters:stripDocumentTabStripscreenPosPoint

Displays a context menu at the specified screen position, associated with the provided DockWindow instance.

C#
public void DisplayContextMenu(DockWindow window, Point screenPos)
Parameters:windowDockWindowscreenPosPoint

Displays a context menu at the specified screen position, associated with the provided DockWindow instance.

C#
public void DisplayContextMenu(RadElement owner, DockWindow window, Point screenPos)
Parameters:ownerRadElementwindowDockWindowscreenPosPoint

Displays the context menu at the specified screen position, using the provided list of items.

C#
protected virtual void DisplayMenuCore(List<RadMenuItemBase> items, Point screenPos)
Parameters:itemsList<RadMenuItemBase>screenPosPoint

Displays the context menu at the specified screen position, using the provided list of items.

C#
protected virtual void DisplayMenuCore(RadElement menuOwner, List<RadMenuItemBase> items, Point screenPos)
Parameters:menuOwnerRadElementitemsList<RadMenuItemBase>screenPosPoint

Disposes the currently displayed menu before releasing the base service resources.

C#
protected override void DisposeManagedResources()

Overrides: RadDockObject.DisposeManagedResources()

Gets the menu items, associated with the specified DockWindow.

C#
public List<RadMenuItemBase> GetContextMenuItems(DockWindow window, bool defaultAction)
Parameters:windowDockWindowdefaultActionbool

True to execute the default action, associated with each item, when an item is clicked.

Returns:

List<RadMenuItemBase>

Gets the menu items, associated with the specified DockWindow.

C#
public List<RadMenuItemBase> GetContextMenuItems(DockWindow window)
Parameters:windowDockWindowReturns:

List<RadMenuItemBase>

The entry point used to handle menu item clicks.

C#
protected virtual void OnContextMenuItemClick(object sender, EventArgs e)
Parameters:senderobjecteEventArgs

Performs the core action, depending on the clicked menu item.

C#
protected virtual void PerformMenuItemAction(DockWindow window, RadMenuItemBase menuItem)
Parameters:windowDockWindowmenuItemRadMenuItemBase

Events

Notifies that a context menu is about to be displayed.

C#
public event ContextMenuDisplayingEventHandler ContextMenuDisplaying

Notifies that a context menu item has been clicked.

C#
public event ContextMenuItemClickEventHandler ContextMenuItemClicked