void leWire_Click(object sender, EventArgs e) { TestWire origin = sender as TestWire; List <Point> result = null; //if (removeWire) //{ // result = wireSolver.RemoveWire(origin.LocationPoint.X, origin.LocationPoint.Y); //} //else { result = wireSolver.AddOrUpdateWire(origin.LocationPoint.X, origin.LocationPoint.Y, this.newType, this.selectedTranser); } foreach (Point t in result) { try { yaaaay[t].updateWireState(wireSolver.getWireTransfer(t)); } catch { } } StringBuilder sb = new StringBuilder(); foreach (Point t in result) { sb.AppendLine(t.ToString()); } //MessageBox.Show("changed items: " + result.Count + "\r\n" + sb.ToString()); }
private void generateButtons() { TestWire leWire; for (int x = 0; x < 12; x++) { for (int y = 0; y < 14; y++) { leWire = new TestWire(x, y); leWire.Click += new EventHandler(leWire_Click); this.Controls.Add(leWire); yaaaay.Add(leWire.LocationPoint, leWire); } } }