示例#1
0
        public void SubscribeToPodcast(string link)
        {
            IsLoading = true;

            try
            {
                rss Rss;
                try
                {
                    Rss = _deserialisedRssProvider.Deserialise(link);
                }
                catch (Exception e)
                {
                    DisplayError(e.Message);
                    return;
                }

                Podcast podcast = new Podcast
                {
                    Title = Rss.channel.title,
                    Url   = link,
                };

                if (Podcasts.Contains(podcast))
                {
                    DisplayError("Already subscribed to podcast");
                    return;
                    //todo highlight or jump to/display
                }

                Podcasts.Add(podcast);
                SaveSubscribedPodcasts();
            }
            finally
            {
                IsLoading = false;
            }
        }