public override async void Execute()
        {
            var newPodcastSubscription = newSubscriptionService.GetSubscriptionUrl();

            if (newPodcastSubscription != null)
            {
                var newPodcast = new Podcast()
                {
                    SubscriptionUrl = newPodcastSubscription
                };
                try
                {
                    await podcastLoader.UpdatePodcast(newPodcast);

                    subscriptionManager.AddPodcast(newPodcast);
                    Utils.AddPodcastToSubscriptionView(subscriptionView, newPodcast);
                }
                catch (WebException)
                {
                    messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL");
                }
                catch (XmlException)
                {
                    messageBoxDisplayService.Show("Sorry, the URL is not a podcast feed");
                }
                catch (XmlRssChannelNodeNotFoundException ex)
                {
                    messageBoxDisplayService.Show(ex.Message);
                }
            }
        }
Exemplo n.º 2
0
        public async override void Execute()
        {
            var newPodcastUrl = newSubscriptionService.GetSubscriptionUrl();

            if (newPodcastUrl != null)
            {
                var pod = new Podcast {
                    SubscriptionUrl = newPodcastUrl
                };
                try
                {
                    await podcastLoader.UpdatePodcast(pod);

                    subscriptionManager.AddSubscription(pod);
                    EventAggregator.Instance.Publish(new PodcastLoadedMessage(pod));
                }
                catch (WebException)
                {
                    messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL");
                }
                catch (XmlException)
                {
                    messageBoxDisplayService.Show("Sorry, that URL is not a podcast feed");
                }
            }
        }
        public async override void Execute()
        {
            var newPodcastUrl = newSubscriptionService.GetSubscriptionUrl();

            if (newPodcastUrl != null)
            {
                var pod = new Podcast()
                {
                    SubscriptionUrl = newPodcastUrl
                };
                try
                {
                    await podcastLoader.UpdatePodcast(pod);

                    subscriptionManager.AddSubscription(pod);
                    Utils.AddPodcastToTreeView(pod, subscriptionView);
                }
                catch (WebException)
                {
                    messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL");
                }
                catch (XmlException)
                {
                    messageBoxDisplayService.Show("Sorry, that URL is not a podcast feed");
                }
            }
        }
        private async void OnButtonAddSubscriptionClick(object sender, EventArgs e)
        {
            var newPodcastUrl = newSubscriptionService.GetSubscriptionUrl();

            if (newPodcastUrl != null)
            {
                var pod = new Podcast()
                {
                    SubscriptionUrl = newPodcastUrl
                };
                try
                {
                    await podcastLoader.UpdatePodcast(pod);

                    podcasts.Add(pod);
                    AddPodcastToTreeView(pod);
                }
                catch (WebException)
                {
                    messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL");
                }
                catch (XmlException)
                {
                    messageBoxDisplayService.Show("Sorry, that URL is not a podcast feed");
                }
            }
        }