예제 #1
0
        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
        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;
        }
        private void BindMyData()
        {
            dsEinstellungenList = new EinstellungenListDataSource();
            dsEinstellungenList.LoadData();
            tblEinstellungen.DataSource = dsEinstellungenList;
            tblEinstellungen.ReloadData();

            AppConfig appConfig = new Config(this).GetAppConfig();

            swAutoDownload.On = appConfig.DataAutomaticUpdate;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            AppConfig appConfig = new Config(null).GetAppConfig();

            if (!appConfig.AppIsConfigured)
            {
                UpDateFeeds();

                EinstellungenViewController vcEinstellungen = Storyboard.InstantiateViewController("Einstellungen") as EinstellungenViewController;
                vcEinstellungen.ScrNewsListVC = this;
                NavigationController.PushViewController(vcEinstellungen, false);
            }
            else
            {
                UpDateFeeds();
                BindMyData();
            }
        }
예제 #5
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.");
			}
		}