Пример #1
0
 private void DoAction(object sender, EventArgs e)
 {
     if (sender is ToolStripMenuItem menuItem &&
         menuItem.Tag is IContextAwareAction action)
     {
         MenuClicked?.Invoke(action, _context);
     }
 }
Пример #2
0
 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 { }
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
        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();
                }
            }
        }
Пример #6
0
 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);
 }