示例#1
0
        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);
            }
        }
示例#2
0
 void EventHandler(object sender, PersonalEvent e)
 {
     Console.WriteLine($"Message to {name}: {e.Message}");
 }