Exemplo n.º 1
0
        private void btSpara_Click(object sender, EventArgs e)
        {
            var newURI = new Uri(tbURL.Text);

            try {
                var newfeed = new RSSFetcher(newURI).Fetch();



                feed.Title    = newfeed.Title;
                feed.Podcasts = newfeed.Podcasts;
                feed.URI      = newfeed.URI;
            } catch (Exception ex) {
                var message = "";

                if (ex is UriFormatException)
                {
                    message = "Ogiltig URL";
                }
                if (ex is XmlException)
                {
                    message = "Ogiltig RRS data";
                }
                if (ex is ArgumentException)
                {
                    message = "Måste ange Kategori";
                }
                var result = MessageBox.Show(message);
            }

            UpdateUI();
        }
Exemplo n.º 2
0
        public async static void UpdateFeedPodcasts(RSSFeed feed)
        {
            var fetcher = new RSSFetcher(feed.URI);

            var onlineFeed = fetcher.Fetch();
            await Task.Run(() => {
                feed.Podcasts = onlineFeed.Podcasts;
            });
        }
Exemplo n.º 3
0
 public static void AddFeed(Uri uri, Category category)
 {
     if (category == null)
     {
         throw new ArgumentException();
     }
     try {
         var feed = new RSSFetcher(uri).Fetch();
         feed.Category = category;
         AddFeed(feed);
     } catch (ValidationExeption ex) {
         throw ex;
     }
 }