internal override void OnWebHostContextMenuShown(object sender, Mono.WebBrowser.ContextMenuEventArgs e) { if (!isWebBrowserContextMenuEnabled) { return; } ContextMenu menu = new ContextMenu(); MenuItem item = new MenuItem("Back", delegate { GoBack(); }); item.Enabled = this.CanGoBack; menu.MenuItems.Add(item); item = new MenuItem("Forward", delegate { GoForward(); }); item.Enabled = this.CanGoForward; menu.MenuItems.Add(item); item = new MenuItem("Refresh", delegate { Refresh(); }); menu.MenuItems.Add(item); menu.MenuItems.Add(new MenuItem("-")); menu.Show(this, PointToClient(MousePosition)); }
internal override void OnWebHostContextMenuShown(object sender, Mono.WebBrowser.ContextMenuEventArgs e) { if (!isWebBrowserContextMenuEnabled) { return; } ContextMenuStrip menu = new ContextMenuStrip(); ToolStripMenuItem item = new ToolStripMenuItem("Back", null, (s, ea) => GoBack()); item.Enabled = this.CanGoBack; menu.Items.Add(item); item = new ToolStripMenuItem("Forward", null, (s, ea) => GoForward()); item.Enabled = this.CanGoForward; menu.Items.Add(item); menu.Items.Add(new ToolStripSeparator()); item = new ToolStripMenuItem("Refresh", null, (s, ea) => Refresh()); menu.Items.Add(item); menu.Show(this, PointToClient(MousePosition)); }
private void OnContextMenuShowing(object sender, Mono.WebBrowser.ContextMenuEventArgs e) { HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[ContextMenuShowingEvent]; if (eh != null) { HtmlElementEventArgs ev = new HtmlElementEventArgs (); eh (this, ev); if (ev.ReturnValue) { owner.OnWebHostContextMenuShown (sender, e); } } }