Esempio n. 1
0
        static void Main(string[] args)
        {
            Shape circle    = new Circle();
            Shape rectangle = new Rectangle();

            RedShapeDecorator redCircle    = new RedShapeDecorator(circle);
            RedShapeDecorator redRectangle = new RedShapeDecorator(rectangle);

            FillShapeDecorator fillRedCircle    = new FillShapeDecorator(redCircle);
            FillShapeDecorator fillRedRectangle = new FillShapeDecorator(redRectangle);

            circle.DrawShape();
            rectangle.DrawShape();

            Console.WriteLine();

            redCircle.DrawShape();

            Console.WriteLine();

            redRectangle.DrawShape();

            Console.WriteLine();

            fillRedCircle.DrawShape();

            Console.WriteLine();

            fillRedRectangle.DrawShape();

            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IShape circle       = new Circle();
            IShape redCircle    = new RedShapeDecorator(new Circle());
            IShape redRectangle = new RedShapeDecorator(new Rectangle());

            circle.Draw();
            redCircle.Draw();
            redRectangle.Draw();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Shape circle       = new Circle();
            Shape redCircle    = new RedShapeDecorator(new Circle());
            Shape redRectangle = new RedShapeDecorator(new Square());

            Console.WriteLine("Circle with normal border");
            circle.Draw();
            Console.WriteLine("\nCircle of red border");
            redCircle.Draw();
            Console.WriteLine("\nRectangle of red border");
            redRectangle.Draw();

            Console.ReadKey(true);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            IShape Circle = new Circle();

            IShape RedCircle = new RedShapeDecorator(new Circle());

            IShape RedRectangle = new RedShapeDecorator(new Rectangle());

            Circle.Drow();

            RedCircle.Drow();

            RedRectangle.Drow();

            Console.ReadLine();
        }
Esempio n. 5
0
        static void Main()
        {
            Console.WriteLine("Circle with normal border");
            var circle = new Circle();

            circle.Draw();

            Console.WriteLine("Circle with red border");
            var redCircle = new RedShapeDecorator(new Circle());

            redCircle.Draw();

            Console.WriteLine("Rectangle with red border");
            var redRectangle = new RedShapeDecorator(new Rectangle());

            redRectangle.Draw();
        }
Esempio n. 6
0
        public static void Main(String[] args)
        {
            IShape circle = new Circle();

            IShape redCircle = new RedShapeDecorator(new Circle());

            IShape redRectangle = new RedShapeDecorator(new Rectangle());

            Console.WriteLine("Circle with normal border");
            circle.draw();

            Console.WriteLine("\nCircle of red border");
            redCircle.draw();

            Console.WriteLine("\nRectangle of red border");
            redRectangle.draw();

            Console.ReadKey();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            IShape circle       = new Circle();
            IShape rectangle    = new Rectangle();
            IShape redCircle    = new RedShapeDecorator(circle);
            IShape redRectangle = new RedShapeDecorator(rectangle);

            Console.WriteLine("Circle with normal border");
            circle.Draw();

            Console.WriteLine("\nCircle with red border");
            redCircle.Draw();

            Console.WriteLine("\nRectangle with normal border");
            rectangle.Draw();

            Console.WriteLine("\nRectangle with red border");
            redRectangle.Draw();

            Console.Read();
        }