Exemplo n.º 1
0
        public void CreateFeedList(PodcastFeed podcastFeed)
        {
            var feedTab = new TabPage();

            tabCtrlFeeds.TabPages.Add(feedTab);

            var feedList = new ListBox();

            feedList.Dock = DockStyle.Fill;
            feedTab.Controls.Add(feedList);

            var rss  = WebFetcher.FetchRss(podcastFeed.Url);
            var feed = RssParser.GetPodcastFeed(rss);

            podcastFeed.PodcastEpisodes = feed.PodcastEpisodes;
            feedTab.Text = podcastFeed.Name;

            foreach (PodcastEpisode podcast in podcastFeed.PodcastEpisodes)
            {
                feedList.Items.Add(podcast.Name);
            }

            ActiveRss.Add(podcastFeed.Id, rss);
            TabPages.Add(podcastFeed.Id, feedTab);
            UpdateClocks.Add(podcastFeed.Id, new UpdateClock(podcastFeed));

            SetUpdateClocks();
            UpdateClocks[podcastFeed.Id].Start();
        }
Exemplo n.º 2
0
        public void RemoveFeedList(PodcastFeed podcastFeed)
        {
            UpdateClocks[podcastFeed.Id].Stop();
            var tabPage = TabPages[podcastFeed.Id];

            tabCtrlFeeds.TabPages.Remove(tabPage);

            TabPages.Remove(podcastFeed.Id);
            UpdateClocks.Remove(podcastFeed.Id);
            ActiveRss.Remove(podcastFeed.Id);
        }