AcManager.Tools.Profile.LapTimesStorage.Set C# (CSharp) Method

Set() public method

public Set ( [ entry ) : void
entry [
return void
        public void Set([NotNull] LapTimeEntry entry) {
            if (entry == null) throw new ArgumentNullException(nameof(entry));
            Set(GetKey(entry.CarId, entry.TrackAcId), Pack(entry));
        }

Usage Example

Beispiel #1
0
        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);
            }
        }
All Usage Examples Of AcManager.Tools.Profile.LapTimesStorage::Set