コード例 #1
0
        internal static void UsageMethod()
        {
            ConcreteComponent  c  = new ConcreteComponent();
            ConcreteDecoratorA d1 = new ConcreteDecoratorA();
            ConcreteDecoratorB d2 = new ConcreteDecoratorB();

            d1.SetComponent(c);
            d2.SetComponent(d1);
            d2.Operation();
        }
コード例 #2
0
 public void UsageMethod()
 {
     ConcreteComponent c = new ConcreteComponent();
     ConcreteDecoratorA d1 = new ConcreteDecoratorA();
     ConcreteDecoratorB d2 = new ConcreteDecoratorB();
     d1.SetComponent(c);
     d2.SetComponent(d1);
     d2.Operation();
 }