コード例 #1
0
 public CherryDecorator(IBakeryComponent baseComponent) : base(baseComponent)
 {
     this.m_Name  = "Cherry";
     this.m_Price = 2.0;
 }
コード例 #2
0
 public CreamDecorator(IBakeryComponent baseComponent) : base(baseComponent)
 {
     this.m_Name  = "Cream";
     this.m_Price = 10.0;
 }
コード例 #3
0
 protected Decorator(IBakeryComponent baseComponent)
 {
     m_BaseComponent = baseComponent;
 }
コード例 #4
0
 public NamemDecorator(IBakeryComponent baseComponent) : base(baseComponent)
 {
     this.m_Name  = "NAme";
     this.m_Price = 500.0;
 }
コード例 #5
0
 public NameCardDecorator(IBakeryComponent baseComponent) : base(baseComponent)
 {
     m_Name  = "Name Card";
     m_Price = 4.0;
 }
コード例 #6
0
 public ArtificialScent(IBakeryComponent baseComponent) : base(baseComponent)
 {
     this.m_Name  = "Artificial Scent";
     this.m_Price = 3.0;
 }
コード例 #7
0
 private static void PrintProductDetails(IBakeryComponent cBase)
 {
     Console.WriteLine(string.Format("Item: {0}, Price: {1}", cBase.GetName(), cBase.GetPrice()));
 }
コード例 #8
0
 private static void PrintProductDetails(IBakeryComponent component)
 {
     Console.WriteLine(); // some whitespace for readability
     Console.WriteLine("Item: {0}, Price: {1}", component.GetName(), component.GetPrice());
 }