private void addTableToUI(TableContainer foundTable) { if (InvokeRequired) { BeginInvoke(new AddTableToUIDelegate(addTableToUI), new object[] { foundTable }); } else { // add to listbox string num = String.Format("{0:0}", listBoxTables.Items.Count + 1); listBoxTables.Items.Add(num + ": " + foundTable.LobbyTable.ToShortString()); if (settings.TableTabs) { // control and table TableRendererControl control = new TableRendererControl(); foundTable.Renderer = control; RendererTab tab = new RendererTab(foundTable, control); // callbacks foundTable.Activated += delegate(TableContainer activated) { tab.Highlight(); }; foundTable.WaitingForBlindToClose += delegate() { tab.SetTitle("Closing" + (foundTable.Number + 1)); }; foundTable.SittingOut += delegate() { tab.SetTitle("SitOut" + (foundTable.Number + 1)); }; foundTable.SittingIn += delegate() { tab.ResetTitle(); }; foundTable.Closed += delegate() { tab.SetTitle("Closed" + (foundTable.Number + 1)); }; foundTable.TimedOut += delegate() { tab.SetTitle("TimeOut" + (foundTable.Number + 1)); }; foundTable.ReActivated += delegate(TableContainer activated) { tab.ResetTitle(); }; // add to form tabMain.Controls.Add(tab); tabPages.Add(tab); } } }
public RendererTab(TableContainer container, TableRendererControl control) { this.container = container; Location = new System.Drawing.Point(4, 22); Name = "tabPage" + container.Number; Padding = new System.Windows.Forms.Padding(3); Size = new System.Drawing.Size(827, 674); TabIndex = container.Number; ResetTitle(); Controls.Add(control); }