Exemple #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);
            }
        }
Exemple #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);
            }
        }
Exemple #3
0
        private void btnTriangle_Click(object sender, EventArgs e)
        {
            tbSelect.Text = "Triangle";
            MessageBox.Show("Triangle selected", "Attantion!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ClassTriangle tt = new ClassTriangle(this);

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