void OnReloadRequired(ReloadRequired message) { if (message.IsNew) { ReloadItem(message.Id); } }
/// <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()); } }
private void _rpc_OnSystemVariableDeleted(RPCController sender) { if (_disposing) { return; } System.Diagnostics.Debug.Write("Position 2"); ReloadRequired?.Invoke(this, ReloadType.SystemVariables); }
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)); } }
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; } } }
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); }
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; }
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); } }
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); }
protected static void OnReloadRequired() { ReloadRequired?.Invoke(null, EventArgs.Empty); }
private void _rpc_OnNewDevices(RPCController sender) { ReloadRequired?.Invoke(this, ReloadType.Full); }
public void WatchToProviderDestroyed(GameObject provider) { ReloadRequired.Invoke(provider, false); }