Пример #1
0
        static void Main(string[] args)
        {
            ConcreteComponent  TextView        = new ConcreteComponent();
            ConcreteDecoratorA ScrollDecorator = new ConcreteDecoratorA();
            ConcreteDecoratorB BorderDecorator = new ConcreteDecoratorB();

            ScrollDecorator.SetComponent(TextView);
            BorderDecorator.SetComponent(ScrollDecorator);
            BorderDecorator.Operation();

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            ConcreteComponent TextView = new ConcreteComponent();
            ConcreteDecoratorA ScrollDecorator = new ConcreteDecoratorA();
            ConcreteDecoratorB BorderDecorator = new ConcreteDecoratorB();

            ScrollDecorator.SetComponent(TextView);
            BorderDecorator.SetComponent(ScrollDecorator);
            BorderDecorator.Operation();

            Console.ReadLine();
        }