public object Clone() { Cycle c = new Cycle(Start, End); c.Name = Name; c.Description = Description; foreach (Signal chS in Signals) { c.Add((Signal)chS.Clone()); } foreach (Cycle chC in Cycles) { c.Add((Cycle)chC.Clone()); } foreach (Variant chV in Variatns) { c.Add((Variant)chV.Clone()); } c.csvVarFile = csvVarFile; //foreach (Property chP in Properties) //{ // s.Add((Property)chP.Clone()); //} return(c); }
private void bt_PastLink_Click(object sender, EventArgs e) { Element el = Program.getElementById(treeView1.SelectedNode.Name); switch (el.GetType().ToString()) { case "VisualTemplate.Signal": break; case "VisualTemplate.Cycle": Cycle c = el as Cycle; c.Add(Program.bufVar); Program.bufVar.Link = Program.bufVar.Id; treeView1.Nodes.Clear(); Program.addToTree(Program.t, treeView1); treeView1.Nodes[0].Expand(); break; } }
private void bt_PastProp_Click(object sender, EventArgs e) { Element el = Program.getElementById(treeView1.SelectedNode.Name); switch (el.GetType().ToString()) { case "VisualTemplate.Signal": Signal s = el as Signal; s.Add((Property)Program.bufProp.Clone()); Program.getProperties(s, dataGridProps, treeView1.SelectedNode); break; case "VisualTemplate.Cycle": Cycle c = el as Cycle; Variant v = (Variant)Program.bufVar.Clone(); Program.setIdtoVar(v); c.Add(v); Program.getVariants(c, dataGridProps); break; } }
private void toolStripButton3_Click(object sender, EventArgs e) { Element el = Program.getElementById(curTempTabPage.TreeView.SelectedNode.Name, curTempTabPage.Id); switch (el.GetType().ToString()) { case "VisualTemplate.Signal": Signal s = el as Signal; s.Add((Property)Program.bufProp.Clone()); Program.getProperties(s, curTempTabPage.dgProps, curTempTabPage.TreeView.SelectedNode); break; case "VisualTemplate.Cycle": Cycle c = el as Cycle; Variant v = (Variant)Program.bufVar.Clone(); Program.setIdtoVar(v); c.Add(v); Program.getVariants(c, curTempTabPage.dgProps); break; } toolStripButton1.Enabled = true; toolStripButton2.Enabled = true; }