public void CloseTab(MongoTab tab) { tab.Session.Stop( ); TabPages.Remove(tab); if (NumTabsChanged != null) { NumTabsChanged( ); } }
private void event_MouseDoubleClick(object sender, MouseEventArgs e) { // Extract the clicked tab. MongoTab tab = GetSelectedTabIndex(e.Location); if (tab != null) { DuplicateTab(tab); } }
//================================================================================= // // PUBLIC METHODS // //================================================================================= public void Add(MongoSession newSession) { var tab = new MongoTab(newSession); TabPages.Add(tab); SelectTab(tab); if (NumTabsChanged != null) { NumTabsChanged( ); } }
//================================================================================= // // PRIVATE METHODS // //================================================================================= private void event_MouseClick(object sender, MouseEventArgs e) { // Extract the clicked tab. MongoTab tab = GetSelectedTabIndex(e.Location); if (tab == null) { return; } switch (e.Button) { case MouseButtons.Middle: // Middle-click to close tabs, like Chrome. CloseTab(tab); break; case MouseButtons.Right: contextTab = tab; tabContextMenu.Show(this, e.Location); break; } }
public void DuplicateTab(MongoTab tab) { Add(new MongoSession(tab.Session.Address.ToString())); }