private void LoadStations(bool forse = false) { if (_stations.Count == 0 || forse) { _stations.Clear(); if (Directory.Exists(ConfigurationClasses.SettingsManager.Instance.StationsRootPath)) { DirectoryInfo rootFolder = new DirectoryInfo(ConfigurationClasses.SettingsManager.Instance.StationsRootPath); foreach (DirectoryInfo stationFolder in rootFolder.GetDirectories()) { CoreObjects.Station station = new CoreObjects.Station(stationFolder); station.LoadExistedDays(DateTime.MinValue, DateTime.MaxValue); _stations.Add(station); } } } }
private void LoadStations() { _stations.Clear(); if (Directory.Exists(ConfigurationClasses.SettingsManager.Instance.StationsRootPath)) { DirectoryInfo rootFolder = new DirectoryInfo(ConfigurationClasses.SettingsManager.Instance.StationsRootPath); foreach (DirectoryInfo stationFolder in rootFolder.GetDirectories()) { CoreObjects.Station station = new CoreObjects.Station(stationFolder); if (!ConfigurationClasses.SettingsManager.Instance.AlwaysCancelDownload && !ConfigurationClasses.SettingsManager.Instance.OfflineMode) { CoreObjects.StationInformation stationInfo = ServiceManager.GetStationInfo(station.Name); if (stationInfo != null) station.NeedToUpdate = station.LastLoaded < stationInfo.LastModified; } _stations.Add(station); } } }