Esempio n. 1
0
        /// All of our MenuItems' click events are handled by this method. It checks the
        /// mapping to see which verb is associated with the MenuItem that sent the event
        /// and then invokes that verb.
        private void menuItem_Click(object sender, EventArgs e)
        {
            MenuItem     key = sender as MenuItem;
            DesignerVerb v   = verbsFromMenuItems[key] as DesignerVerb;

            v.Invoke();
        }
 protected override void OnClick(EventArgs e)
 {
     if (_verb != null)
     {
         _verb.Invoke();
     }
 }
Esempio n. 3
0
 void InvokeCommand(object sender, EventArgs e)
 {
     try {
         verb.Invoke();
     } catch (Exception ex) {
         MessageService.ShowException(ex);
     }
 }
Esempio n. 4
0
 void InvokeCommand(object sender, EventArgs e)
 {
     try
     {
         verb.Invoke();
     }
     catch (Exception ex)
     {
         Trace.Write("MenuCommandServiceImpl: " + ex.ToString());
     }
 }
Esempio n. 5
0
 void InvokeCommand(object sender, EventArgs e)
 {
     try
     {
         verb.Invoke();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 6
0
 private void Init()
 {
     this.Action =
         delegate(object sender, ToolStripItemCodonEventArgs codon)
     {
         if (_contextMenuCommand != null)
         {
             _contextMenuCommand.Run();
         }
         else if (_designerVerb != null)
         {
             _designerVerb.Invoke();
         }
     };
 }
Esempio n. 7
0
        /// called to invoke menu item verbs
        private void MenuItemClickHandler(object sender, EventArgs e)
        {
            // get the menu item
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;

            if (menuItem != null)
            {
                // get and invoke the verb
                DesignerVerb verb = menuItemVerb[menuItem] as DesignerVerb;
                if (verb != null)
                {
                    try
                    {
                        verb.Invoke();
                    }
                    catch {}
                }
            }
        }
        /// <summary>
        /// 单击谓词连接
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void linkLabelVerb_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DesignerVerb verb = e.Link.LinkData as DesignerVerb;

            verb.Invoke();
        }
 /// <summary>
 ///  Programmatically executes the method associated with the item.
 /// </summary>
 public override void Invoke()
 {
     _verb.Invoke();
 }
Esempio n. 10
0
 public override void Invoke()
 {
     targetVerb.Invoke();
 }
Esempio n. 11
0
 /// <summary>
 ///  Programmatically executes the method associated with the item.
 /// </summary>
 public override void Invoke() => _verb.Invoke();