private void InitializeRaceEssentials() { if (_raceEssentialsStorage != null) { return; } _raceEssentialsStorage = new LapTimesStorage(RaceEssentialsLapTimesReader.SourceId); }
private void InitializeAcNew() { if (_acStorageNew != null) { return; } _acStorageNew = new LapTimesStorage(AcLapTimesNewReader.SourceId); }
private void InitializeSidekick() { if (_sidekickStorage != null) { return; } _sidekickStorage = new LapTimesStorage(SidekickLapTimesReader.SourceId); }
private void InitializeAc() { if (_acDbStorage != null) { return; } _acDbStorage = new LapTimesStorage(AcLapTimesReader.SourceId); }
private void InitializeCm() { if (_cmStorage != null) { return; } _cmStorage = new LapTimesStorage(SourceId); }
public void ClearCache() { if (_readerFunc == null) { return; } // if reader is null, storage is the only source of lap times — don’t clear it! var filename = _storage.Filename; _storage.Dispose(); File.Delete(filename); _storage = new LapTimesStorage(DisplayName, Id); SetDirty(); }
public LapTimesSource([NotNull] string id, string displayName, string description, string enabledKey, bool enabledByDefault, bool autoAddAllowed, [CanBeNull] Func <ILapTimesReader> readerFunc, Func <Task> preparationFunc) { _changeId = id.GetHashCode(); _readerFunc = readerFunc; _preparationFunc = preparationFunc; Id = id; DisplayName = displayName; Description = description; AutoAddAllowed = autoAddAllowed; _storage = new LapTimesStorage(DisplayName, Id); _enabledKey = enabledKey; _autoAddKey = _enabledKey + ":autoAdd"; var enabledByDefault1 = enabledByDefault; _isEnabled = ValuesStorage.GetBool(_enabledKey, enabledByDefault1); _autoAddEntries = ValuesStorage.GetBool(_autoAddKey, enabledByDefault1); }
private void InitializeSidekick() { if (_sidekickStorage != null) return; _sidekickStorage = new LapTimesStorage(SidekickLapTimesReader.SourceId); }
private void InitializeAc() { if (_acStorage != null) return; _acStorage = new LapTimesStorage(AcLapTimesReader.SourceId); }
private void InitializeCm() { if (_cmStorage != null) return; _cmStorage = new LapTimesStorage(SourceId); }