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