private void BindMyData() { CheckBox cbDateIndicate = FindViewById<CheckBox>(Resource.Id.cbDateIndicate); CheckBox cbDataUpdate = FindViewById<CheckBox>(Resource.Id.cbDataUpdate); // Konfiguration laden Config config = new Config(this); AppConfig appConfig = config.GetAppConfig(); cbDateIndicate.Checked = appConfig.DateIndicate; cbDataUpdate.Checked = appConfig.DataAutomaticUpdate; List<WSFeedConfig.FeedConfig> feedConfig = config.GetWSConfig(); ListView lvDataSubscription = FindViewById<ListView>(Resource.Id.lvDataSubscription); settingsFeedListAdapter = new SettingsFeedListAdapter(this, feedConfig); lvDataSubscription.Adapter = settingsFeedListAdapter; }
public void UpdateFeeds() { Logging.Log(this, Logging.LoggingTypeDebug, "UpdateFeeds() - before lock"); lock(lockObject) { Logging.Log(this, Logging.LoggingTypeDebug, "UpdateFeeds() - in lock"); // Konfiguration vom Webserver laden Logging.Log(this, Logging.LoggingTypeDebug, "Konfiguration vom Webserver laden"); List<WSFeedConfig.FeedConfig> feedsConfig = new WSFeedConfig().GetFeedConfig(); Logging.Log(this, Logging.LoggingTypeDebug, "Konfiguration in der Datenbank speichern"); Config config = new Config(this); // Konfiguration in der Datenbank speichern config.SetWSConfig(feedsConfig); // Neu aus der DB laden um auch die FeedID zu bekommen. feedsConfig = config.GetWSConfig(); Logging.Log(this, Logging.LoggingTypeInfo, "Feedimport start."); foreach(WSFeedConfig.FeedConfig feed in feedsConfig) { // Nur aktive feeds laden if (!feed.IsActive) continue; string webSource = new Download().DownloadWebSource(feed.Url); if (!string.IsNullOrEmpty(webSource)) { switch(feed.FeedType) { case WSFeedConfig.FeedTypes.News: new feedimport.Rss().ImportRss(feed, webSource); break; } } } Logging.Log(this, Logging.LoggingTypeInfo, "Feedimport abgeschlossen."); } }