//Invoke the loan event public virtual void OnLoan(LoanEventArgs args) { if (Loan != null) { Loan(this, args); } }
public override void LoanHandler(object sender, LoanEventArgs args) { if (args.Loan.Amount < 45000) { Console.WriteLine($"{ this.GetType().Name } Approval Request #{args.Loan.Number}"); } else if (Successor != null) { Successor.LoanHandler(this, args); } }
//Event Handler public abstract void LoanHandler(object sender, LoanEventArgs args);