Exemple #1
0
        protected override bool OnContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams state, int commandId, CefEventFlags eventFlags)
        {
            if (commandId == (int)ContextMenuHelper.MenuIdentifier.MENU_ID_SHOW_DEVTOOLS)
            {
                _owner.ShowDevTools();
                return(true);
            }

            if (commandId == (int)ContextMenuHelper.MenuIdentifier.MENU_ID_HIDE_DEVTOOLS)
            {
                _owner.WebView.BrowserHost.CloseDevTools();
                return(true);
            }

            var e = new ContextMenuCommandEventArgs(frame, state, commandId, eventFlags);

            _owner.InvokeIfRequired(() => _owner.OnContextMenuCommand(e));

            return(e.Handled);
        }