Click or drag to resize
CfxContextMenuHandler Class

[This is preliminary documentation and is subject to change.]

Implement this structure to handle context menu events. The functions of this structure will be called on the UI thread.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxClientBase
        ChromiumCfxContextMenuHandler

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxContextMenuHandler : CfxClientBase

The CfxContextMenuHandler type exposes the following members.

Constructors
  NameDescription
Public methodCfxContextMenuHandler
Initializes a new instance of the CfxContextMenuHandler class
Top
Properties
  NameDescription
Public propertyCallbacksDisabled
When true, all CEF callback events are disabled for this handler. Incoming callbacks will return default values to CEF.
(Inherited from CfxClientBase.)
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted client struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxClientBase.)
Top
Events
  NameDescription
Public eventOnBeforeContextMenu
Called before a context menu is displayed. |Params| provides information about the context menu state. |Model| initially contains the default context menu. The |Model| can be cleared to show no context menu or modified to show a custom menu. Do not keep references to |Params| or |Model| outside of this callback.
Public eventOnContextMenuCommand
Called to execute a command selected from the context menu. Return true (1) if the command was handled or false (0) for the default implementation. See CfxMenuId for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |Params| will have the same values as what was passed to on_before_context_menu(). Do not keep a reference to |Params| outside of this callback.
Public eventOnContextMenuDismissed
Called when the context menu is dismissed irregardless of whether the menu was NULL or a command was selected.
Public eventRunContextMenu
Called to allow custom display of the context menu. |Params| provides information about the context menu state. |Model| contains the context menu model resulting from OnBeforeContextMenu. For custom display return true (1) and execute |Callback| either synchronously or asynchronously with the selected command ID. For default display return false (0). Do not keep references to |Params| or |Model| outside of this callback.
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_context_menu_handler_capi.h.
See Also