// The Decorator delegates all work to the wrapped component. public override string Operation() { if (_component != null) { return(_component.Operation()); } else { return(string.Empty); } }
// 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()); }
// 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()); }