예제 #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);
 }