/// 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(); } }
void InvokeCommand(object sender, EventArgs e) { try { verb.Invoke(); } catch (Exception ex) { MessageService.ShowException(ex); } }
void InvokeCommand(object sender, EventArgs e) { try { verb.Invoke(); } catch (Exception ex) { Trace.Write("MenuCommandServiceImpl: " + ex.ToString()); } }
void InvokeCommand(object sender, EventArgs e) { try { verb.Invoke(); } catch (Exception ex) { throw; } }
private void Init() { this.Action = delegate(object sender, ToolStripItemCodonEventArgs codon) { if (_contextMenuCommand != null) { _contextMenuCommand.Run(); } else if (_designerVerb != null) { _designerVerb.Invoke(); } }; }
/// 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(); }
public override void Invoke() { targetVerb.Invoke(); }
/// <summary> /// Programmatically executes the method associated with the item. /// </summary> public override void Invoke() => _verb.Invoke();