public void HandleStorageEvent(JsonElement oEvent) { var evt = new StorageEvent(oEvent); _log.LogTrace("Raise local storage change event."); StorageUpdated?.Invoke(evt); }
public void Update(StorageObjectsRemoveMessage message) { for (int i = 0; i < message.ObjectUIDList.Count; i++) { Objects.RemoveAll(o => o.UID == message.ObjectUIDList[i]); } StorageUpdated?.Invoke(); }
public void Update(StorageObjectUpdateMessage message) { var obj = Objects.FirstOrDefault(f => f.UID == message.Object.ObjectUID); // Needs to be added if (obj == null) { Objects.Add(new ObjectEntry(message.Object, DataManager.Get <Items>((int)message.Object.ObjectGID))); } // Needs to be updated else { obj.Update(message.Object); } StorageUpdated?.Invoke(); }
public async Task SetItem(string key, string value) { _log.LogTrace("Set {key} in local storage", key); try { await _interop.InvokeVoidAsync(JSNamespace + ".LocalStorage.setItem", key, value); StorageUpdated?.Invoke(new StorageEvent(key, null, value)); } catch (JSException jsError) { var error = EnrichError.TryUnwrap(jsError); _log.LogError("JSError: " + error.Message); throw error; } }
public void Update(StorageObjectsUpdateMessage message) { for (int i = 0; i < message.ObjectList.Count; i++) { var obj = Objects.FirstOrDefault(f => f.UID == message.ObjectList[i].ObjectUID); // Needs to be added if (obj == null) { Objects.Add(new ObjectEntry(message.ObjectList[i], DataManager.Get <Items>((int)message.ObjectList[i].ObjectGID))); } // Needs to be updated else { obj.Update(message.ObjectList[i]); } } StorageUpdated?.Invoke(); }
private async Task Save() { if (String.IsNullOrWhiteSpace(Storage.StorageName)) { await this.pageService.DisplayAlert("Error", "Please enter a storage name.", "Ok"); return; } if (Storage.Id == 0) { await this.storageStore.AddStorageType(Storage); StorageAdded?.Invoke(this, Storage); } else { await this.storageStore.UpdateStorageType(Storage); StorageUpdated?.Invoke(this, Storage); } await this.pageService.PopAsync(); }
private void Reload(bool force, StorageUpdated msg = null) { logger.Information("Initialize {EntityType}", msg?.Entity?.GetType()?.Name); if (msg != null) { switch (msg.Entity) { //case RecordingSessionDto: case CheckpointDto: //case TimingSessionDto: return; } } var timingSession = eventRepository.StorageService.Get(Id); if (!timingSession.IsRunning && !force) { return; } logger.Information("Initialize updating subscription"); disposable?.DisposeSafe(); disposable = new CompositeDisposable(); var session = eventRepository.GetWithUpstream(timingSession.SessionId); GateId = eventRepository.GetGateId(timingSession.SessionId); checkpointHandler = new TimingCheckpointHandler(timingSession.StartTime, Id, session, eventRepository.GetRiderIdentifiers(timingSession.SessionId), messageHub); disposable.Add(checkpointHandler); var cps = recordingServiceRepository .GetCheckpoints(timingSession.GateId, timingSession.StartTime, timingSession.StopTime); foreach (var cp in cps) { recordingService.AppendCheckpoint(GateId, autoMapper.Map <Checkpoint>(cp)); } }
public async Task RemoveItem(string key) { await _interop.InvokeVoidAsync("window.localStorage.removeItem", key); StorageUpdated?.Invoke(new StorageEvent(key, null, null)); }
public async Task Clear() { await _interop.InvokeVoidAsync("window.localStorage.clear"); StorageUpdated?.Invoke(new StorageEvent(null, null, null)); }
public void Update(StorageObjectRemoveMessage message) { Objects.RemoveAll(o => o.UID == message.ObjectUID); StorageUpdated?.Invoke(); }
public void Update(StorageKamasUpdateMessage message) { Kamas = message.KamasTotal; StorageUpdated?.Invoke(); }