コード例 #1
0
ファイル: Settings.cs プロジェクト: ybs2011/ADFC-NewsApp-Mono
        protected override void OnPause()
        {
            base.OnPause ();

            CheckBox cbDateIndicate = FindViewById<CheckBox>(Resource.Id.cbDateIndicate);
            CheckBox cbDataUpdate = FindViewById<CheckBox>(Resource.Id.cbDataUpdate);

            // Konfiguration speichern
            AppConfig appConfig = new AppConfig();
            appConfig.DateIndicate = cbDateIndicate.Checked;
            appConfig.DataAutomaticUpdate = cbDataUpdate.Checked;

            Config config = new Config(this);
            config.SetAppConfig(appConfig);
            config.SetWSConfig(settingsFeedListAdapter.GetFeedConfig);
        }
コード例 #2
0
		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.");
			}
		}