Example #1
0
 void OnReloadRequired(ReloadRequired message)
 {
     if (message.IsNew)
     {
         ReloadItem(message.Id);
     }
 }
Example #2
0
 /// <summary>
 /// Apply changes on the WorkspaceContainer, the update event handler will get trigger if anything was changed
 /// </summary>
 /// <param name="pType"></param>
 /// <param name="pEvents"></param>
 private void Monitor_Updated(WorkspaceType pType, List <FSEventInfo> pEvents)
 {
     try {
         Updater.Apply(Container, VideoInfoProvider, pType, pEvents);
     } catch (Exception) {
         ReloadRequired?.Invoke(this, new EventArgs());
     }
 }
Example #3
0
        private void _rpc_OnSystemVariableDeleted(RPCController sender)
        {
            if (_disposing)
            {
                return;
            }

            System.Diagnostics.Debug.Write("Position 2");
            ReloadRequired?.Invoke(this, ReloadType.SystemVariables);
        }
Example #4
0
 public void Complete(TodoItem item)
 {
     item.IsCompleted = true;
     if (Repository.HasChanges(item.Id, item))
     {
         int itemId = Repository.Save(item);
         // Sending the ReloadRequired message for the specific item
         Messenger.Default.Send(ReloadRequired.FromId(itemId));
     }
 }
Example #5
0
 void OnReloadRequired(ReloadRequired message)
 {
     if (message == ReloadRequired.All || message.IsNew)
     {
         // Reload all Items when new item added or explicit reload requested
         ReloadItems(ShowAllItems);
     }
     else
     {
         // Reload the specific item within the Items collection
         var item = Repository.ReloadItem(Items, message.Id);
         if (item == SelectedItem)
         {
             SelectedItem = item;
         }
     }
 }
Example #6
0
        private void _rpc_OnSystemVariableUpdated(RPCController sender, SystemVariable value)
        {
            if (_disposing)
            {
                return;
            }

            if (!SystemVariables.ContainsKey(value.Name))
            {
                System.Diagnostics.Debug.Write("Position 1");
                ReloadRequired?.Invoke(this, ReloadType.SystemVariables);
                return;
            }
            SystemVariable variable = SystemVariables[value.Name];

            variable.SetValue(value);
            SystemVariableUpdated?.Invoke(this, variable);
        }
Example #7
0
        public void Save()
        {
            bool isNew   = IsNew;
            int  savedId = Repository.Save(Item);

            if (isNew)
            {
                // Sending the ReloadRequired message for new item
                Messenger.Default.Send(ReloadRequired.FromNew(savedId));
            }
            else
            {
                // Sending the ReloadRequired message for the specific item
                Messenger.Default.Send(ReloadRequired.FromId(savedId));
            }

            HasChanges = false;
        }
Example #8
0
        private void _rpc_OnNewEvent(RPCController sender, string id, EventType type, long peerId, long channelIndex, string variable)
        {
            if (type == EventType.Timed)
            {
                ReloadRequired?.Invoke(this, ReloadType.Events);
            }
            else
            {
                if (!Devices.ContainsKey(peerId))
                {
                    return;
                }

                Device device = Devices[peerId];
                if (!device.Channels.ContainsKey(channelIndex))
                {
                    return;
                }

                Channel channel = device.Channels[channelIndex];
                DeviceReloadRequired?.Invoke(this, device, channel, DeviceReloadType.Events);
            }
        }
Example #9
0
        private void _rpc_OnMetadataUpdated(RPCController sender, long peerId, MetadataVariable value)
        {
            if (_disposing)
            {
                return;
            }

            if (!Devices.ContainsKey(peerId))
            {
                ReloadRequired?.Invoke(this, ReloadType.Full);
                return;
            }
            Device device = Devices[peerId];

            if (!device.Metadata.ContainsKey(value.Name))
            {
                DeviceReloadRequired?.Invoke(this, device, null, DeviceReloadType.Metadata);
                return;
            }
            MetadataVariable variable = device.Metadata[value.Name];

            variable.SetValue(value);
            MetadataUpdated?.Invoke(this, device, variable);
        }
Example #10
0
 protected static void OnReloadRequired()
 {
     ReloadRequired?.Invoke(null, EventArgs.Empty);
 }
Example #11
0
 private void _rpc_OnNewDevices(RPCController sender)
 {
     ReloadRequired?.Invoke(this, ReloadType.Full);
 }
Example #12
0
 public void WatchToProviderDestroyed(GameObject provider)
 {
     ReloadRequired.Invoke(provider, false);
 }