/* * protected virtual void OnOverdrawn (OverdrawnEventArgs args) * * Not sure why the original method was set up to be virtual. * Virtual means you can optionally override the method. I am * not sure why we would want to ever override. * */ protected void OnOverdrawn(OverdrawnEventArgs args) { if (Overdrawn != null) { Overdrawn(this, args); } }
private static void Acct_Overdrawn(object sender, OverdrawnEventArgs e) { if (sender is BankAccount) { if (e.CurrentBalance < e.DebitAmount) { Console.WriteLine("There is a $25.00 overdraft fee!"); } } }
private void Heardit(BankAccountEI b, OverdrawnEventArgs e) { Console.WriteLine("Account is overdrawn Balance is {0} Amount is {1}", e.CurrentBalance, e.DebitAmount); }