public MongoSessionPanel( MongoTab parent ) { InitializeComponent( ); ParentTab = parent; Dock = DockStyle.Fill; statusPanel.Dock = DockStyle.Fill; AutoCompleteMaker.Initialize( this ); }
public MongoSessionPanel(MongoTab parent) { InitializeComponent( ); ParentTab = parent; Dock = DockStyle.Fill; statusPanel.Dock = DockStyle.Fill; AutoCompleteMaker.Initialize(this); }
//================================================================================= // // 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() ) ); }
public void CloseTab( MongoTab tab ) { tab.Session.Stop( ); TabPages.Remove( tab ); if ( NumTabsChanged != null ) NumTabsChanged( ); }