Beispiel #1
0
        public override void Execute()
        {
            if (subscriptionView.SelectedNode.Tag is Podcast pod)
            {
                subscriptionManager.RemoveSubscription(pod);
                subscriptionView.RemoveNode(pod.Id.ToString());
            }

            else if (subscriptionView.SelectedNode.Tag is Episode episode)
            {
                var relatedPodcast = subscriptionManager.Subscriptions.Where(p => p.Episodes.Where(ep => ep.Guid == episode.Guid).Any()).FirstOrDefault();
                subscriptionManager.RemoveSubscription(relatedPodcast);
                subscriptionView.RemoveNode(relatedPodcast.Id.ToString());
            }
            EventAggregator.Instance.Publish(new PodcastLoadCompleteMessage(subscriptionManager.Subscriptions.ToArray()));
        }
        public override void Execute()
        {
            if (subscriptionView.SelectedNode.Tag is Podcast podcast)
            {
                subscriptionManager.RemovePodcast(podcast);
                subscriptionView.RemoveNode(podcast.Id.ToString());
                Utils.SelectFirstEpisode(subscriptionView, subscriptionManager);
            }

            else if (subscriptionView.SelectedNode.Tag is Episode episode)
            {
                var relatedPodcast = subscriptionManager.Podcasts.Where(p => p.Episodes.Where(ep => ep.Guid == episode.Guid).Any()).FirstOrDefault();
                subscriptionManager.RemovePodcast(relatedPodcast);
                subscriptionView.RemoveNode(relatedPodcast.Id.ToString());
                Utils.SelectFirstEpisode(subscriptionView, subscriptionManager);
            }
        }
 private void OnButtonRemoveClick(object sender, EventArgs e)
 {
     if (_subscriptionView.SelectedNode.Tag is Podcast podToRemove)
     {
         _podcasts.Remove(podToRemove);
         _subscriptionView.RemoveNode(podToRemove.Id.ToString());
         SelectFirstEpisode();
     }
 }
        public override void Execute()
        {
            var pod = subscriptionView.SelectedNode.Tag as Podcast;

            if (pod != null)
            {
                subscriptionManager.RemoveSubscription(pod);
                subscriptionView.RemoveNode(pod.Id.ToString());
                Utils.SelectFirstEpisode(subscriptionView, subscriptionManager);
            }
        }
Beispiel #5
0
        private void OnButtonRemovePodcastClick(object sender, EventArgs e)
        {
            var pod = subscriptionView.SelectedNode.Tag as Podcast;

            if (pod != null)
            {
                podcasts.Remove(pod);
                subscriptionView.RemoveNode(pod.Id.ToString());
                SelectFirstEpisode();
            }
        }
Beispiel #6
0
        public override void Execute()
        {
            var pod = subscriptionView.SelectedNode.Tag as Podcast;

            if (pod != null)
            {
                subscriptionManager.RemoveSubscription(pod);
                subscriptionView.RemoveNode(pod.Id.ToString());
                EventAggregator.Instance.Publish(new PodcastLoadCompleteMessage(subscriptionManager.Subscriptions.ToArray()));
            }
        }