public static void OnEmailAddressChanged(EmailAddress oldAddress, EmailAddress newAddress) { var handler = EmailAddressChanged; if (handler != null) { var args = new EmailAddressChangedEventArgs { OldAddress = oldAddress, NewAddress = newAddress }; handler(null, args); } }
/// <summary> /// Handler for the EmailAddressChanged event /// </summary> private void NotifyCustomerWhenEmailChanged(object sender, EmailAddressChangedEventArgs args) { // just log it for now. // a real version would put a message on a queue, for example Log("Email Address Changed from : {0} to {1}", args.OldAddress.Email, args.NewAddress.Email); }