/// <summary>
        /// Occurs when any event is thrown in the controller
        /// Filters all the events and only passes the events which have a corresponding eventsubscription
        /// </summary>
        /// <param name="sender">Controller</param>
        /// <param name="eventMessage">Custom data from the event</param>
        protected void OnEventReceived(object sender, EventMessage eventMessage)
        {
            EventMessage QueriedEventMessage = new EventMessage();

            QueriedEventMessage.EventSubscriptionId = this.EventSubscription.EventId;
            QueriedEventMessage.EventType           = this.EventSubscription.EventType;

            TagBlink TempTagBlink;

            if (WsnQueryHelper.TryQuery(this.EventSubscription, eventMessage.TagBlink, out TempTagBlink))
            {
                QueriedEventMessage.TagBlink = TempTagBlink;
                this.EventReceived(sender, QueriedEventMessage);
            }
        }
예제 #2
0
 /// <summary>
 /// Implements the service
 /// Processes the Query
 /// </summary>
 /// <param name="query">Query</param>
 /// <returns>QueryResult</returns>
 public QueryResponse Query(Query query)
 {
     return(WsnQueryHelper.Query(query, MyDB));
 }