Exemple #1
0
 // Define what actions to take when the event is raised.
 void HandlerWorkersEvent(object sender, WorkerEventBusMessage e)
 {
     if (!e.Message.Contains(worker.workerName))
     {
         Console.WriteLine(worker.workerName + " observed that " + e.Message);
     }
 }
Exemple #2
0
        protected virtual void OnRaiseCustomEvent(WorkerEventBusMessage e)
        {
            EventHandler <WorkerEventBusMessage> handler = RaiseWorkerEvent;

            // Event will be null if there are no subscribers
            if (handler != null)
            {
                handler(this, e);
            }
        }