private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { string id = (string)OverviewTable.CurrentCell.Value; if (!tabControl1.Controls.ContainsKey(id)) { if (client.isConnected()) { clientTab tab = new clientTab(id, client, _ID); if (!_tabs.Contains(tab)) _tabs.Add(tab); if (!_tabIdDict.ContainsKey(id)) _tabIdDict.Add(id, tab); tab.closeAllButThisButton.Click += new System.EventHandler(On_Tab_Close_All_Event); tab.closeButton.Click += new System.EventHandler(On_Tab_Closed_Event); this.tabControl1.Controls.Add(tab); this.tabControl1.SelectedTab = tab; } } }
// code wordt niet gebruikt? private void getClients() { string[] ids = getActiveClients().Split(' '); for (int i = 0; i < ids.Length; i++) { if (!this.tabControl1.Controls.ContainsKey(ids[i])) { clientTab tab = new clientTab(ids[i], client, _ID); this.tabControl1.Controls.Add(tab); } } }
private void HandleFileRequest(Packet p) { string[] data = p._message.Split('-'); if (!tabControl1.Controls.ContainsKey(data[1] + "-" + data[2])) { if (_client.isConnected()) { clientTab tab = new clientTab(data[1] + "-" + data[2], _client, _ID, true); if (!_tabs.Contains(tab)) _tabs.Add(tab); if (!_tabIdDict.ContainsKey(data[1] + "-" + data[2])) _tabIdDict.Add(data[1] + "-" + data[2], tab); tab.closeAllButThisButton.Click += new System.EventHandler(On_Tab_Close_All_Event); tab.closeButton.Click += new System.EventHandler(On_Tab_Closed_Event); this.tabControl1.Controls.Add(tab); this.tabControl1.SelectedTab = tab; tab.setMaxMeasurements(int.Parse(data[3])); } } }