/// <summary> /// Add items to the context menu. /// </summary> private void OnContextMenuInvoked(object sender, HtmlContextMenuEventArgs eventArgs) { RContextMenu contextMenu = eventArgs.ContextMenu; string searchEngineTitle = Preferences.StandardPreferences.DefaultSearchEngine; contextMenu.AddItem(string.Format(Resources.SearchWith, searchEngineTitle), !string.IsNullOrEmpty(GetSelection()), OnContextMenuClick); }
/// <summary> /// Propagate the ContextMenuInvoked event from root container. /// </summary> protected virtual void OnContextMenuInvoked(HtmlContextMenuEventArgs e) { var handler = ContextMenuInvoked; if (handler != null) handler(this, e); }
private void OnContextMenuInvoked(object sender, HtmlContextMenuEventArgs e) { OnContextMenuInvoked(e); }
/// <summary> /// Handle context menu customisation by the caller /// </summary> /// <param name="contextMenu">the context menu to customise</param> internal void HandleContextMenuInvoked(RContextMenu contextMenu) { EventHandler<HtmlContextMenuEventArgs> contextMenuHandler = ContextMenuInvoked; if (contextMenuHandler != null) { var args = new HtmlContextMenuEventArgs(contextMenu); try { contextMenuHandler(this, args); } catch (Exception ex) { throw new Exception("Error in context menu intercept", ex); } } }