Exemple #1
0
 public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
 {
     if (parameters.LinkUrl != "")
     {
         model.InsertSeparatorAt(0);
         model.InsertItemAt(0, (CefMenuCommand)26502, "Copy link address");
         model.InsertSeparatorAt(0);
         model.InsertItemAt(0, (CefMenuCommand)26501, "Open in new tab");
     }
 }
        public override void OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
        {
            int count = 0;

            if (!string.IsNullOrWhiteSpace(parameters.SelectionText))
            {
                model.InsertItemAt(0, Search, "menu_search");
                count++;
            }
            if (!string.IsNullOrWhiteSpace(parameters.LinkUrl))
            {
                model.InsertCheckItemAt(0, OpenInNewWindow, "menu_openInNewWindow");
                count++;
            }

            if (count > 0)
            {
                model.InsertSeparatorAt(count);
            }
        }
Exemple #3
0
 protected static void InsertSelectionSearchItem(IMenuModel model, CefMenuCommand insertCommand, string insertLabel)
 {
     model.InsertItemAt(model.GetIndexOf(MenuSearchInBrowser) + 1, insertCommand, insertLabel);
 }