Woopsa.BaseWoopsaSubscriptionServiceSubscription.EnqueueNewMonitoredValue C# (CSharp) Method

EnqueueNewMonitoredValue() protected method

protected EnqueueNewMonitoredValue ( IWoopsaValue newValue ) : void
newValue IWoopsaValue
return void
        protected void EnqueueNewMonitoredValue(IWoopsaValue newValue)
        {
            if (!newValue.IsSameValue(_oldValue))
            {
                _oldValue = newValue;
                if (newValue.TimeStamp == null)
                    newValue = WoopsaValue.CreateUnchecked(newValue.AsText, newValue.Type, DateTime.Now);
                WoopsaServerNotification newNotification = new WoopsaServerNotification(newValue, SubscriptionId);
                lock (_lock)
                {
                    if (MonitorInterval == WoopsaSubscriptionServiceConst.MonitorIntervalLastPublishedValueOnly)
                        _notifications.Clear();
                    _notifications.Add(newNotification);
                }
            }
        }