Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 private void TsmiXML_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < figure.Count; i++)
     {
         programstate.listfigure.Add(new figureSerialiaze(figure.ElementAt(i)));
     }
     ClassSerialiaze.SerialiazeToXml <ClassProgramState>(programstate, "testXML.xml");
     MessageBox.Show("Figures are save", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
 }