Пример #1
0
 // Invoke the Purchase event
 public virtual void OnPurchase(PurchaseEventArgs e)
 {
     if (Purchase != null)
     {
         Purchase(this, e);
     }
 }
Пример #2
0
 public override void PurchaseHandler(object sender, PurchaseEventArgs e)
 {
     if (e.Purchase.Amount < 10000.0)
     {
         Console.WriteLine("{0} approved request# {1}",
             this.GetType().Name, e.Purchase.Number);
     }
     else if (Successor != null)
     {
         Successor.PurchaseHandler(this, e);
     }
 }
Пример #3
0
 // Purchase event handler
 public abstract void PurchaseHandler(object sender, PurchaseEventArgs e);
Пример #4
0
 // Purchase event handler
 public abstract void PurchaseHandler(object sender, PurchaseEventArgs e);
Пример #5
0
 public void ProcessRequest(Purchase purchase)
 {
     PurchaseEventArgs e = new PurchaseEventArgs { Purchase = purchase };
     OnPurchase(e);
 }