Example #1
0
 /// <summary>
 /// message received
 /// </summary>
 void comms_OnMessage(object sender, MessageEventArgs e)
 {
     //Need to know event name and parameters
     DiPSEvent dEvent = JsonConvert.DeserializeObject<DiPSEvent>(e.Data);
     //check if we have a subscription
     if(dEvent.MessageType == MessageType.EventFired &&  _Subscriptions.ContainsKey(dEvent.EventName))
     {
         _Subscriptions[dEvent.EventName](dEvent.PayLoad);
     }
 }
Example #2
0
 private void enqueueToMessageEventQueue(MessageEventArgs e)
 {
     lock (_forMessageEventQueue)
     _messageEventQueue.Enqueue (e);
 }