protected virtual void OnNewMail2(NewMailEventArgs e) { if (newMail != null) { newMail(this, e); } }
protected virtual void OnNewMail(NewMailEventArgs e) { EventHandler <NewMailEventArgs> temp = Volatile.Read(ref newMail); if (temp != null) { temp(this, 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); }
public void SimulateNeMail(string from, string to, string subject) { //create object for keep information,to be sent to the recipients of the notification NewMailEventArgs e = new NewMailEventArgs(from, to, subject); OnNewMail(e); }