public void OnNewMail(NewMailEventArgs e) { EventHandler <NewMailEventArgs> temp = Volatile.Read(ref NewMail); if (temp != null) { temp(this, e); } }
public void SimulateNewMail(string from, string to, string subject) { NewMailEventArgs e = new NewMailEventArgs(from, to, subject); OnNewMail(e); }
protected void OnNewMail(NewMailEventArgs e) { Volatile.Read(ref NewMail)?.Invoke(this, e); }
public void OnNewMail(object obj, NewMailEventArgs args) { Console.WriteLine(args.From); Console.WriteLine(args.To); Console.WriteLine(args.Subject); }