private void sOAPToolStripMenuItem_Click(object sender, EventArgs e) { ClassProgramState temp1 = new ClassProgramState(); ClassSerialiaze.DeserializationFromSoap <ClassProgramState>(ref temp1, "testSOAP.soap"); for (var k = 0; k < temp1.array.Count(); k++) { if (temp1.array[k].name == "Circle") { ClassCircle cc = new ClassCircle(); cc.convert(temp1.array[k], this); figure.Add(cc); } else if (temp1.array[k].name == "Rectangle") { ClassRectangle rr = new ClassRectangle(); rr.convert(temp1.array[k], this); figure.Add(rr); } else if (temp1.array[k].name == "Triangle") { ClassTriangle tt = new ClassTriangle(); tt.convert(temp1.array[k], this); figure.Add(tt); } } for (int i = 0; i < figure.Count; i++) { figure.ElementAt(i).Paint(this); } }
private void bINToolStripMenuItem_Click(object sender, EventArgs e) { ClassProgramState temp = new ClassProgramState(); ClassSerialiaze.DeserializationFromBIN <ClassProgramState>(ref temp, "testBIN.bin"); for (var i = 0; i < temp.array.Count(); i++) { if (temp.array[i].name == "Circle") { ClassCircle cc = new ClassCircle(); cc.convert(temp.array[i], this); figure.Add(cc); } else if (temp.array[i].name == "Rectangle") { ClassRectangle rr = new ClassRectangle(); rr.convert(temp.array[i], this); figure.Add(rr); } else if (temp.array[i].name == "Triangle") { ClassTriangle tt = new ClassTriangle(); tt.convert(temp.array[i], this); figure.Add(tt); } } for (int i = 0; i < figure.Count; i++) { figure.ElementAt(i).Paint(this); } }