Ejemplo n.º 1
0
 // The Decorator delegates all work to the wrapped component.
 public override string Operation()
 {
     if (_component != null)
     {
         return(_component.Operation());
     }
     else
     {
         return(string.Empty);
     }
 }
Ejemplo n.º 2
0
 // The client code works with all objects using the Component interface.
 // This way it can stay independent of the concrete classes of
 // components it works with.
 public void ClientCode(Component component)
 {
     _log.Enqueue("RESULT: " + component.Operation());
 }
Ejemplo n.º 3
0
 // The client code works with all objects using the Component interface.
 // This way it can stay independent of the concrete classes of
 // components it works with.
 public void ClientCode(Component component)
 {
     Console.WriteLine("RESULT: " + component.Operation());
 }