コード例 #1
0
ファイル: SourcesDirector.cs プロジェクト: sm-g/weatherlog
        public DateTime GetStationLastFetchTime(IAbstractDataSource source, Station station)
        {
            Dictionary <string, DateTime> sourceTimes;

            if (!_lastFetchTimes.TryGetValue(station.Id, out sourceTimes))
            {
                sourceTimes = SourcesDatabase.LoadLastFetchTimes(station);
                if (sourceTimes.Count == 0)
                {
                    return(DateTime.MinValue);
                }
                else
                {
                    _lastFetchTimes[station.Id] = sourceTimes;
                }
            }
            return(sourceTimes[source.Id]);
        }
コード例 #2
0
ファイル: SourcesDirector.cs プロジェクト: sm-g/weatherlog
 internal void FlushFetchTimes(IEnumerable <Station> stations)
 {
     SourcesDatabase.SaveLastFetchTimes(AllDataSources, stations);
 }