Beispiel #1
0
        private void UpdateEpisodes()
        {
            EnableControls(false);
            var previousTitle = Text;
            Text = "Aggiornamento lista episodi...";

            web = transmission.Crawler;

            lsEpisodes.Items.Clear();
            lsEpisodes.Items.Add("Sto scaricando la lista degli episodi...");

            var count = 0;
            var page = 1;
            do
            {
                var newEpisodes = web.ExtractEpisodes(web.DownloadPage(page));
                count = db.AddRange(newEpisodes);
                page++;
            }
            while(count != 0);
            db.WriteTo(episodesFile);

            lsEpisodes.Items.Clear();
            lsEpisodes.Items.AddRange(db.GetRange());
            Text = previousTitle;
            updatedTrasmission[transmission.Code] = true;
            EnableControls(true);
        }