Exemple #1
0
        public override void BuildQuad()
        {
            QuadFactory qf = new QuadFactory();
            drawQuad    qd = (drawQuad)qf.makeShape();

            p.add(qd.r);
        }
        private void F1_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
        {
            for (int i = 0; i < objnum; i++)
            {
                switch (objtype)
                {
                case "круг":
                    CircleFactory cf  = new CircleFactory();
                    drawCircle    crc = (drawCircle)cf.makeShape();
                    crc.e.MouseDown += circleclick;
                    canvas.Children.Add(crc.e);
                    Thread.Sleep(2);
                    break;

                case "квадрат":
                    QuadFactory qf = new QuadFactory();
                    drawQuad    qd = (drawQuad)qf.makeShape();
                    canvas.Children.Add(qd.r);
                    Thread.Sleep(2);
                    break;

                case "прямоугольник":
                    RectFactory rf  = new RectFactory();
                    drawRect    rct = (drawRect)rf.makeShape();
                    canvas.Children.Add(rct.r);
                    Thread.Sleep(2);
                    break;
                }
            }
        }