コード例 #1
0
ファイル: Client.cs プロジェクト: shwetakarn/StrategyPattern
 // 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();
 }
コード例 #3
0
 public void SetPaymentStrategy(IPaymentStrategy paymentStrategy)
 {
     this.paymentStrategy = paymentStrategy;
 }