private void buttonAddConnectionToItems_Click(object sender, EventArgs e) { ConnectionBetweenPlayerAndItems con = new ConnectionBetweenPlayerAndItems(playerTablesToUse, itemTablesToUse, deleteControlCallback); splitContainer1.Panel1.Controls.Add(con); rearangeControls(); }
private void showConnections() { Control tmp; List <ConnectionsInTables> toRemove = new List <ConnectionsInTables>(); foreach (ConnectionsInTables con in connectionsToCreate) { try { switch (con.type) { case ConnectionsInTables.ConnectionType.GA: { tmp = new ConnectionBetweenPlayerAndItems(playerTablesToUse, itemTablesToUse, deleteControlCallback); ((ConnectionBetweenPlayerAndItems)tmp).setTables(con.sourceTable, con.targetTable); splitContainer1.Panel1.Controls.Add(tmp); break; } case ConnectionsInTables.ConnectionType.MTM: { tmp = new ConnectionBetweenPlayerTables(playerTablesToUse, deleteControlCallback); ((ConnectionBetweenPlayerTables)tmp).setTables(con.sourceTable, con.targetTable, "∞", "∞"); splitContainer1.Panel1.Controls.Add(tmp); break; } case ConnectionsInTables.ConnectionType.MTO: { tmp = new ConnectionBetweenPlayerTables(playerTablesToUse, deleteControlCallback); ((ConnectionBetweenPlayerTables)tmp).setTables(con.sourceTable, con.targetTable, "∞", "1"); splitContainer1.Panel1.Controls.Add(tmp); break; } case ConnectionsInTables.ConnectionType.OTM: { tmp = new ConnectionBetweenPlayerTables(playerTablesToUse, deleteControlCallback); ((ConnectionBetweenPlayerTables)tmp).setTables(con.sourceTable, con.targetTable, "1", "∞"); splitContainer1.Panel1.Controls.Add(tmp); break; } case ConnectionsInTables.ConnectionType.OTO: { tmp = new ConnectionBetweenPlayerTables(playerTablesToUse, deleteControlCallback); ((ConnectionBetweenPlayerTables)tmp).setTables(con.sourceTable, con.targetTable, "1", "1"); splitContainer1.Panel1.Controls.Add(tmp); break; } } } catch (Exception) { toRemove.Add(con); } } foreach (ConnectionsInTables con in toRemove) { connectionsToCreate.Remove(con); } toRemove.Clear(); }