public async Task AddEntryAsync(LapTimeEntry entry) { await EnsureActualAsync(); try { if (!_storage.IsBetter(entry)) { Logging.Debug($"Better entry available ({Id})"); return; } Logging.Debug($"New entry ({Id}): {entry.LapTime}"); SetDirty(); _storage.Set(entry); if (_readerFunc != null) { using (var reader = _readerFunc()) { reader.Export(new[] { entry }); _storage.SyncLastModified(reader); } } OnPropertyChanged(nameof(LastModified)); OnPropertyChanged(nameof(EntriesCount)); } catch (Exception e) { Logging.Error(e); } }
private void AddEntry(LapTimeEntry entry) { InitializeCm(); if (_cmStorage.IsBetter(entry)) { _cmStorage.Set(entry); UpdateAsync().Forget(); } }