Beispiel #1
0
        public override void BuildRect()
        {
            RectFactory rf  = new RectFactory();
            drawRect    rct = (drawRect)rf.makeShape();

            p.add(rct.r);
        }
Beispiel #2
0
        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;
                }
            }
        }