Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
        private void btnCirle_Click(object sender, EventArgs e)
        {
            tbSelect.Text = "Circle";
            MessageBox.Show("Circle selected", "Attantion!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ClassCircle cc = new ClassCircle(this);

            cc.name              = "Circle";
            cc.MyEventCollision += new MyCollision(HandlerEvent);
            figure.Add(cc);
            for (int i = 0; i < figure.Count; i++)
            {
                figure.ElementAt(i).detectCollision(figure);
                figure.ElementAt(i).Paint(this);
            }
        }