예제 #1
0
 public void OnStorageUpdate(string server, int deviceChannel, StorageNotificationType type)
 {
     _isStorageUpdated = true;
     _storageUpdate    = new CallbackObjects.StorageUpdate {
         DeviceChannel = deviceChannel, NotificationType = type, ServerName = server
     };
 }
예제 #2
0
        void NotifyListeners(StorageNotificationType notificationType, IDictionary <StorageNotificationType, List <Action <ItemSnapshot> > > notification, ItemSnapshot itemSnapshot)
        {
            if (notification.ContainsKey(notificationType))
            {
                var events = notification[notificationType];
                foreach (var evt in events)
                {
                    evt.Invoke(itemSnapshot);
                }

                if (notificationType == StorageNotificationType.ONCE)
                {
                    notification[notificationType].Clear();
                }
            }
        }