private void DoAction(object sender, EventArgs e) { if (sender is ToolStripMenuItem menuItem && menuItem.Tag is IContextAwareAction action) { MenuClicked?.Invoke(action, _context); } }
private void DoAction(object sender, EventArgs e) { if (sender is ToolStripMenuItem menuItem && menuItem.Tag is IContextAwareAction action) { var point = menuItem.GetCurrentParent().Location; MenuClicked?.Invoke(point, action); } }
private void fire_OnClickEvent() { if (MenuClicked != null) { try { MenuClicked.Invoke(this, new ToolStripItemClickedEventArgs(this)); } catch { } } }
public void ShowTabMenu(int relativeIndex) { hoverTabIndex += relativeIndex; if (hoverTabIndex >= tabs.Count) { hoverTabIndex = 0; } if (hoverTabIndex < 0) { hoverTabIndex += tabs.Count; } Refresh(); MenuClicked.Invoke(this, (ApplicationMode)hoverTabIndex); }
public void SetSelectedIndex(int targetIndex, bool menuClicked) { if (menuClicked || targetIndex == selectedTabIndex) { if (MenuClicked != null) { MenuClicked.Invoke(this, (ApplicationMode)targetIndex); } } else { selectedTabIndex = targetIndex; if (TabClicked != null) { TabClicked.Invoke(this, (ApplicationMode)selectedTabIndex); this.Refresh(); } } }
public void ShowTabMenu(ApplicationMode appMode) { hoverTabIndex = (int)appMode; Refresh(); MenuClicked.Invoke(this, appMode); }
private void OnMenuClicked() { MenuClicked?.Invoke(this, EventArgs.Empty); }
private void MenuButtonClicked(object sender, EventArgs e) { MenuClicked?.Invoke(this, e); }