public override void Handle(Receiver receiver)
 {
     if (receiver.BankTransfer == true)
         Console.WriteLine("Выполняем банковский перевод");
     else if (Successor != null)
         Successor.Handle(receiver);
 }
 public override void Handle(Receiver receiver)
 {
     if (receiver.MoneyTransfer == true)
         Console.WriteLine("Выполняем перевод через системы денежных переводов");
     else if (Successor != null)
         Successor.Handle(receiver);
 }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     Receiver receiver = new Receiver(false, true, true);
     PaymentHandler bankPaymentHandler = new BankPaymentHandler();
     PaymentHandler moneyPaymentHnadler = new MoneyPaymentHandler();
     PaymentHandler paypalPaymentHandler = new PayPalPaymentHandler();
     bankPaymentHandler.Successor = paypalPaymentHandler;
     paypalPaymentHandler.Successor = moneyPaymentHnadler;
     bankPaymentHandler.Handle(receiver);
     Console.Read();
 }
Exemplo n.º 4
0
 public abstract void Handle(Receiver receiver);