Exemplo n.º 1
0
        public bool LoadPodcastFeedAsync(PodcastFeed sub, uint maxItems)
        {
            string url     = sub.RssLink;
            bool   success = true;

            try
            {
                Stream rssStream;
                using (var client = new RssWebClient(sub))
                {
                    client.OpenReadCompleted += LoadSubscriptionOpenReadCompleted;
                    rssStream = client.OpenRead(url);
                }
                using (var reader = new StreamReader(rssStream))
                {
                    string rss = reader.ReadToEnd();
                    LoadPodcastFeed(sub, rss, maxItems);
                }
            }
            catch (Exception ex)
            {
                OnError(ex.ToString());
                success = false;
            }
            return(success);
        }
Exemplo n.º 2
0
        public bool LoadSubscriptionAsync(PodcastFeed sub)
        {
            string url     = sub.RssLink;
            bool   success = true;

            try
            {
                using (var client = new RssWebClient(sub))
                {
                    client.OpenReadCompleted += LoadSubscriptionOpenReadCompleted;
                    client.OpenReadAsync(new Uri(url));
                }
            }
            catch (Exception ex)
            {
                OnError(ex.ToString());
                success = false;
            }
            return(success);
        }
Exemplo n.º 3
0
        public bool LoadPodcastFeed(PodcastFeed sub, uint maxItems)
        {
            string url     = sub.RssLink;
            bool   success = true;

            try
            {
                Stream rssStream;
                using (var client = new RssWebClient(sub))
                {
                    rssStream = client.OpenRead(url);
                }
                using (var reader = new StreamReader(rssStream))
                {
                    string rss = reader.ReadToEnd();
                    LoadPodcastFeed(sub, rss, maxItems);
                }
            }
            catch (Exception)
            {
                success = false;
            }
            return(success);
        }