/// <summary> /// Notify clients that a tab was selected. /// </summary> protected void InvokeTabClicked(Tab tabClicked) { if (TabClicked != null) { TabClicked.Invoke(tabClicked); } }
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)); } }
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(); } } }
private void OnClick() { TabClicked?.Invoke(this); }