public void AddNewTab(string directory) { TabButton tab = new TabButton(directory); tab.MouseDown += Tab_MouseDown; tab.DragEnter += Tab_DragEnter; tab.DragOver += TabControl_DragOver; tab.OnClickX += Tab_OnClickX; tabs.Add(tab); this.Controls.Add(tab); TabRefresh(); tab.QueryContinueDrag += Tab_QueryContinueDrag; }
public void TabButton_Init() { TabButton temp = new TabButton("test"); Assert.AreEqual("test", temp.ButtonText); }
public void RemoveTab(TabButton tab) { int index = tabs.IndexOf(tab); tabs.Remove(tab); this.Controls.Remove(tab); TabButton temp = tabs.ElementAtOrDefault(index); if (temp == null) { temp = tabs.ElementAtOrDefault(--index); } if (temp == null) { if(this.NoTabExist != null) this.NoTabExist(tab); TabRefresh(); return; } this.ShowTab(index); this. TabRefresh(); }