private void lb_iterations_SelectedIndexChanged(object sender, EventArgs e) { if (lb_iterations.SelectedIndex != -1) { System.Runtime.Serialization.Formatters.Binary.BinaryFormatter f = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); System.IO.Stream s = new System.IO.FileStream("debug/CircuitParts/" + lb_parts.SelectedIndex.ToString() + "/" + lb_iterations.SelectedIndex.ToString() + ".bin", System.IO.FileMode.Open); cp = f.Deserialize(s) as Logics.CircuitPart; s.Close(); } ReDraw(); }
public void LoadList() { lb_iterations.Items.Clear(); lb_parts.Items.Clear(); cp = null; offset = new Point(panel1.Width / 2, panel1.Height / 2); var a = System.IO.Directory.GetDirectories("debug/CircuitParts"); for (int i = 0; i < a.Length; i++) { lb_parts.Items.Add(i.ToString()); } ReDraw(); }