コード例 #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();
        }
コード例 #2
0
 protected override void OnClick(EventArgs e)
 {
     if (_verb != null)
     {
         _verb.Invoke();
     }
 }
コード例 #3
0
 void InvokeCommand(object sender, EventArgs e)
 {
     try {
         verb.Invoke();
     } catch (Exception ex) {
         MessageService.ShowException(ex);
     }
 }
コード例 #4
0
 void InvokeCommand(object sender, EventArgs e)
 {
     try
     {
         verb.Invoke();
     }
     catch (Exception ex)
     {
         Trace.Write("MenuCommandServiceImpl: " + ex.ToString());
     }
 }
コード例 #5
0
ファイル: MenuCommandService.cs プロジェクト: iamwsx05/hms
 void InvokeCommand(object sender, EventArgs e)
 {
     try
     {
         verb.Invoke();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #6
0
 private void Init()
 {
     this.Action =
         delegate(object sender, ToolStripItemCodonEventArgs codon)
     {
         if (_contextMenuCommand != null)
         {
             _contextMenuCommand.Run();
         }
         else if (_designerVerb != null)
         {
             _designerVerb.Invoke();
         }
     };
 }
コード例 #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 {}
                }
            }
        }
コード例 #8
0
        /// <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();
 }
コード例 #10
0
 public override void Invoke()
 {
     targetVerb.Invoke();
 }
コード例 #11
0
 /// <summary>
 ///  Programmatically executes the method associated with the item.
 /// </summary>
 public override void Invoke() => _verb.Invoke();