protected virtual void OnNewPack(NewPackEventArgs e) { EventHandler <NewPackEventArgs> temp = Volatile.Read(ref NewPack); if (temp != null) { temp(this, e); } }
private void PostMsg(Object sender, NewPackEventArgs e) { Console.WriteLine("Message about new pack"); Console.WriteLine("From={0}, TO={1}, Content={2}, Delivery={3}", e.From, e.To, e.Content, e.Delivery); }
public void SimulateNewPack(string from, string to, string content, string delivery) { NewPackEventArgs e = new NewPackEventArgs(from, to, content, delivery); OnNewPack(e); }