protected virtual void OnPublicEvent(PersonalEvent e) { EventHandler <PersonalEvent> handler = this.PublicEvent; if (handler != null) { e.Message += string.Format($" at {DateTime.Now.ToString()}"); handler(this, e); } }
void EventHandler(object sender, PersonalEvent e) { Console.WriteLine($"Message to {name}: {e.Message}"); }