Beispiel #1
0
 /// <summary>
 /// Notify clients that a tab was selected.
 /// </summary>
 protected void InvokeTabClicked(Tab tabClicked)
 {
     if (TabClicked != null)
     {
         TabClicked.Invoke(tabClicked);
     }
 }
Beispiel #2
0
        private void FancySidemenu_MouseDown(object sender, MouseEventArgs e)
        {
            int  protoY  = (int)(e.Y / (float)Height * tabs.Length);
            bool changed = protoY != y;

            if (changed)
            {
                selected = protoY;
                UpdateSelectionCache();
                UpdateUI();
            }

            if (TabClicked != null)
            {
                TabClicked.Invoke(this, new SelectionEventArgs(protoY, changed));
            }
        }
Beispiel #3
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();
                }
            }
        }
Beispiel #4
0
 private void OnClick()
 {
     TabClicked?.Invoke(this);
 }