Пример #1
0
        static void Main(string[] args)
        {
            ShapeFactory shapeFactory = new ShapeFactory();

            IShape shape1 = shapeFactory.getShape("Circle");

            shape1.draw();

            IShape shape2 = shapeFactory.getShape("Rectangle");

            shape2.draw();

            IShape shape3 = shapeFactory.getShape("Square");

            shape3.draw();
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            ShapeFactory shapeFactory = new ShapeFactory();

            Shape shape1 = shapeFactory.getShape("CIRCLE");

            shape1.draw();

            Shape shape2 = shapeFactory.getShape("RECTANGLE");

            shape2.draw();

            Shape shape3 = shapeFactory.getShape("SQUARE");

            shape3.draw();

            Console.ReadLine();
        }