Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Propagate the ContextMenuInvoked event from root container.
        /// </summary>
        protected virtual void OnContextMenuInvoked(HtmlContextMenuEventArgs e)
        {
            var handler = ContextMenuInvoked;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 3
0
        /// <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);
                }
            }
        }
Ejemplo n.º 4
0
 private void OnContextMenuInvoked(object sender, HtmlContextMenuEventArgs e)
 {
     OnContextMenuInvoked(e);
 }