static void Main(string[] args) { ConcreateComponet c=new ConcreateComponet(); ConcreateDecoratorA d1 = new ConcreateDecoratorA(); ConcreateDecoratorB d2 = new ConcreateDecoratorB(); d1.SetDecorator(c); d2.SetDecorator(d1); d2.Operation(); Console.ReadKey(); }
static void Main(string[] args) { ConcreateComponet c = new ConcreateComponet(); ConcreateDecoratorA d1 = new ConcreateDecoratorA(); ConcreateDecoratorB d2 = new ConcreateDecoratorB(); d1.SetDecorator(c); d2.SetDecorator(d1); d2.Operation(); Console.ReadKey(); }