protected virtual void OnRaiseCustomEvent(ChairEventBusMessage e) { EventHandler <ChairEventBusMessage> handler = RaiseChairEvent; // Event will be null if there are no subscribers if (handler != null) { handler(this, e); } }
// Define what actions to take when the event is raised. void HandleCustomEvent(object sender, ChairEventBusMessage e) { worker.operateBus(e.Message, e.Chair); }