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

GetCachedLapTimesList() private method

private GetCachedLapTimesList ( ILapTimesReader reader ) : IReadOnlyList
reader ILapTimesReader
return IReadOnlyList
        public IReadOnlyList<LapTimeEntry> GetCachedLapTimesList(ILapTimesReader reader) {
            var lastUpdated = GetDateTime(KeyLastUpdated);
            return lastUpdated.HasValue && reader.GetLastModified() < lastUpdated.Value ?
                    GetLapTimes().ToList() : null;
        }

Usage Example

Example #1
0
        private async Task <IReadOnlyList <LapTimeEntry> > ReadRaceEssentialsEntriesAsync()
        {
            InitializeRaceEssentials();
            var raceEssentialsDirectory = Path.Combine(FileUtils.GetPythonAppsDirectory(AcRootDirectory.Instance.RequireValue), "RaceEssentials");

            using (var reader = new RaceEssentialsLapTimesReader(raceEssentialsDirectory, this)) {
                var result = _raceEssentialsStorage.GetCachedLapTimesList(reader);
                if (result != null)
                {
                    return(result);
                }

                await TracksManager.Instance.EnsureLoadedAsync();

                return(_raceEssentialsStorage.UpdateCachedLapTimesList(reader));
            }
        }
All Usage Examples Of AcManager.Tools.Profile.LapTimesStorage::GetCachedLapTimesList