Beispiel #1
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();
        }
Beispiel #2
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);
        }
Beispiel #3
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();
        }
        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();
        }