// Raise the Overdrawn event. protected virtual void OnOverdrawn(OverdrawnEventArgs args) { if (Overdrawn != null) { Overdrawn(this, args); } }
// The event handler with event args. private void OverdrawnHandler(object sender, OverdrawnEventArgs args) { string message = "The account is overdrawn." + Environment.NewLine + "Current Balance: " + args.CurrentBalance.ToString("C") + Environment.NewLine + "Debit Amount: " + args.DebitAmount.ToString("C"); MessageBox.Show(message); }
// The event handler with event args. private static void OverdrawnHandler(object sender, OverdrawnEventArgs args) { string message = "The account is overdrawn." + Environment.NewLine + "Current Balance: " + args.CurrentBalance.ToString("C") + Environment.NewLine + "Debit Amount: " + args.DebitAmount.ToString("C"); Console.Write(message); }