public C0List Clone() { C0List C = new C0List(); foreach (LevelObj lev in l) { C.l.Add(lev.Clone()); } return(C); }
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value) { IWindowsFormsEditorService svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; C0List v = value as C0List; if (svc != null && v != null) { ((Form1)System.Windows.Forms.Application.OpenForms["Form1"]).EditC0List(v.List); } return(v); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { result = new C0List(); propertyGrid1.SelectedObject = (C0List)result; } else if (comboBox1.SelectedIndex == 1) { result = new int[1] { 0 }; propertyGrid1.SelectedObject = (int[])result; } else if (comboBox1.SelectedIndex == 2) { result = new Rail(); propertyGrid1.SelectedObject = (Rail)result; } else if (comboBox1.SelectedIndex == 3) { result = new Node("", "A0"); propertyGrid1.SelectedObject = (Node)result; } else if (comboBox1.SelectedIndex == 4) { result = new Node("0", "D1"); propertyGrid1.SelectedObject = (Node)result; } else if (comboBox1.SelectedIndex == 5) { result = new Node("0", "D2"); propertyGrid1.SelectedObject = (Node)result; } else if (comboBox1.SelectedIndex == 6) { label2.Visible = true; numericUpDown1.Visible = true; return; } label2.Visible = false; numericUpDown1.Visible = false; }