public bool CreateFileBrowseTab(String name, ushort ident) { int index = -1; for (int i = 0; i < this.tabControl1.TabPages.Count; i++) { if (this.tabControl1.TabPages[i] is BrowseTab) { if (this.tabControl1.TabPages[i].Text == name) { index = i; break; } } } if (index > -1) { this.tabControl1.SelectedIndex = index; return(false); } else { BrowseTab new_tab = new BrowseTab(name); new_tab.ImageIndex = 3; new_tab.BrowseIdent = ident; this.tabControl1.TabPages.Add(new_tab); this.tabControl1.SelectedIndex = (this.tabControl1.TabPages.Count - 1); return(true); } }
private void toolStripButton1_Click(object sender, EventArgs e) { if (this.Mode == ScreenMode.Main) { this.CloseClicked(this.EndPoint, EventArgs.Empty); } else { int index = this.tabControl1.SelectedIndex; if (index > 0) { this.tabControl1.SelectedIndex = 0; if (this.tabControl1.TabPages[index] is PMTab) { PMTab pm = (PMTab)this.tabControl1.TabPages[index]; this.tabControl1.TabPages.RemoveAt(index); pm.HashlinkClicked -= this.LinkHashlinkClicked; pm.EditScribbleClicked -= this.DoEditScribbleClicked; pm.Free(); pm.Dispose(); pm = null; } else if (this.tabControl1.TabPages[index] is BrowseTab) { BrowseTab bt = (BrowseTab)this.tabControl1.TabPages[index]; this.tabControl1.TabPages.RemoveAt(index); bt.Free(); bt.Dispose(); bt = null; } } } }
public void CloseAllTabs(bool including_main) { if (including_main) { this.tabControl1.TabPages.RemoveAt(0); while (this.splitContainer1.Panel1.Controls.Count > 0) { this.splitContainer1.Panel1.Controls.RemoveAt(0); } while (this.splitContainer1.Panel2.Controls.Count > 0) { this.splitContainer1.Panel2.Controls.RemoveAt(0); } this.splitContainer1.Dispose(); this.splitContainer1 = null; while (this.tabPage1.Controls.Count > 0) { this.tabPage1.Controls.RemoveAt(0); } this.tabPage1.Dispose(); this.tabPage1 = null; this.userListContainer1.Free(); this.userListContainer1.Dispose(); this.userListContainer1 = null; } // pm and file tabs for (int i = (this.tabControl1.TabPages.Count - 1); i > -1; i--) { if (this.tabControl1.TabPages[i] is PMTab) { PMTab pm = (PMTab)this.tabControl1.TabPages[i]; this.tabControl1.TabPages.RemoveAt(i); pm.HashlinkClicked -= this.LinkHashlinkClicked; pm.EditScribbleClicked -= this.DoEditScribbleClicked; pm.Free(); pm.Dispose(); pm = null; } else if (this.tabControl1.TabPages[i] is BrowseTab) { BrowseTab bt = (BrowseTab)this.tabControl1.TabPages[i]; this.tabControl1.TabPages.RemoveAt(i); bt.Free(); bt.Dispose(); bt = null; } } }
public void BrowseError(ushort ident) { for (int i = 0; i < this.tabControl1.TabPages.Count; i++) { if (this.tabControl1.TabPages[i] is BrowseTab) { BrowseTab tab = (BrowseTab)this.tabControl1.TabPages[i]; if (tab.BrowseIdent == ident) { tab.ErrorReceived(); break; } } } }
public void StartBrowse(ushort ident, ushort count) { for (int i = 0; i < this.tabControl1.TabPages.Count; i++) { if (this.tabControl1.TabPages[i] is BrowseTab) { BrowseTab tab = (BrowseTab)this.tabControl1.TabPages[i]; if (tab.BrowseIdent == ident) { tab.StartReceived(count); break; } } } }