protected virtual void OnRaiseCustomEvent(CustomEventAgrs e) { EventHandler <CustomEventAgrs> handler = RaiseCustomEvent; if (handler != null) { e.Message += string.Format("at {0}", DateTime.Now.ToString()); handler(this, e); } }
void HandleCustomEvent(object sender, CustomEventAgrs e) { Console.WriteLine(id + " received this message: {0}", e.Message); }