Пример #1
0
        private async void ladeDaten()
        {
            try
            {
                Uri source = new Uri("https://opendata.arcgis.com/datasets/917fc37a709542548cc3be077a786c17_0.csv", UriKind.Absolute);
                BackgroundDownloader downloader = new BackgroundDownloader();

                Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder);
                StorageFile testfile = await folder.CreateFileAsync("data.csv", CreationCollisionOption.ReplaceExisting);

                DownloadOperation download = downloader.CreateDownload(source, testfile);
                await download.StartAsync();

                await Task.Delay(TimeSpan.FromSeconds(5));

                if (parser == null)
                {
                    parser = new CSV_Parser();
                }
                parser.getDaten();
                await Task.Delay(TimeSpan.FromSeconds(5));

                int lol = parser.getDatenLange();
                Debug.WriteLine(lol);
                LiveKachelCreator library = new LiveKachelCreator();
                library.sendMessage(OldDataService.getOldLandkreis(), parser.getIndex(OldDataService.getOldLandkreis()));
                try
                {
                    ladeGrid();
                }
                catch (Exception e)
                {
                    Debug.WriteLine("Download Error", e);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Download Error", ex);
            }
        }
        public SettingsPage()
        {
            InitializeComponent();

            textBox_landkreis.Text = OldDataService.getOldLandkreis();
        }