public void SimulateNewMail(string from, string to, string subject) { var e = new NewMailEventArgs(from, to, subject); Task.Run(() => OnNewMail(e)); }
public void FaxMsg(object sender, NewMailEventArgs e) { //if (m_id == 2) throw new Exception("just say something"); Console.WriteLine($"{m_id}_{e.From}_{e.To}_{e.Subject}"); }
//public event EventHandler Mail; protected virtual void OnNewMail(NewMailEventArgs e) { Volatile.Read(ref NewMail)?.Invoke(this, e); }