示例#1
0
 // The user will set the PaymentStrategy by
 // calling this method at runtime
 public void SetPaymentStrategy(IPaymentStrategy strategy)
 {
     this.PaymentStrategy = strategy;
 }
示例#2
0
 public void CheckOut(IPaymentStrategy paymentMethod)
 {
     Display();
     paymentMethod.Pay(_totalAmount);
     GoodsList.Clear();
 }
 public void SetPaymentStrategy(IPaymentStrategy paymentStrategy)
 {
     this.paymentStrategy = paymentStrategy;
 }