protected virtual void OnNewMail(NewMailEventArgs e) { //EventHandler<NewMailEventArgs> temp = NewMail; if (NewMail != null) { NewMail(this, e); } }
public void SimulateNEwMail(string from, string to, string subject) { NewMailEventArgs e = new NewMailEventArgs(from, to, subject); OnNewMail(e); }
private void FaxMsg(Object sender, NewMailEventArgs e) { Console.WriteLine("Faxing mail message"); Console.WriteLine("From: {0}. To: {1}. Subject: {2}.", e.From, e.To, e.Subject); }