// BalanceChanged is called by the Account Com object // whenever the balance of the account has been changed. // Fire the AccountChanged event to notify the main form // that the balance has changed. public void BalanceChanged(int newBalance) { AccountChangedEventArgs args = new AccountChangedEventArgs(newBalance); if (AccountChanged != null) { AccountChanged(this, args); } }
// Called when the notification object fires the event indicating that the account balance // has been changed. Update the balance field in the user interface with the new balance. private void AccountChangedMsg(Object sender, AccountChangedEventArgs args) { balanceTextBox.Text = args.NewBalance.ToString(CultureInfo.InvariantCulture); }