コード例 #1
0
ファイル: Guru.cs プロジェクト: happy-bits/design-patterns
 // The Decorator delegates all work to the wrapped component.
 public override string Operation()
 {
     if (_component != null)
     {
         return(_component.Operation());
     }
     else
     {
         return(string.Empty);
     }
 }
コード例 #2
0
ファイル: Guru.cs プロジェクト: happy-bits/design-patterns
 // 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());
 }
コード例 #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());
 }