示例#1
0
 public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager)
 {
     if (!subscriptionView.IsEmpty())
     {
         subscriptionView.SelectNode(subscriptionManager.Podcasts.SelectMany(p => p.Episodes).First().Guid);
     }
 }
示例#2
0
 public SubscriptionPresenter(ISubscriptionView subscriptionView, IPodcastPlayer podcastPlayer)
 {
     this.subscriptionView              = subscriptionView;
     this.podcastPlayer                 = podcastPlayer;
     subscriptionView.SelectionChanged += OnSelectedEpisodeChanged;
     EventAggregator.Instance.Subscribe <PodcastLoadedMessage>(m => AddPodcastToTreeView(m.Podcast));
     EventAggregator.Instance.Subscribe <PodcastLoadCompleteMessage>(m => subscriptionView.SelectNode(m.Subscriptions.SelectMany(p => p.Episodes).First().Guid));
 }
        public void AddPodcastToTreeView(Podcast podcast)
        {
            var podNode = new TreeNode(podcast.Title)
            {
                Tag = podcast, Name = podcast.Id.ToString()
            };

            foreach (var episode in podcast.Episodes)
            {
                podNode.Nodes.Add(new TreeNode(episode.Title)
                {
                    Tag = episode, Name = episode.Guid
                });
            }

            subscriptionView.AddNode(podNode);
            if (subscriptionView.SelectedNode == null)
            {
                subscriptionView.SelectNode(podNode.FirstNode.Name);
            }
        }
示例#4
0
 private void SelectFirstEpisode()
 {
     subscriptionView.SelectNode(podcasts.SelectMany(p => p.Episodes).First().Guid);
 }
示例#5
0
 public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager)
 {
     subscriptionView.SelectNode(subscriptionManager.Subscriptions.SelectMany(p => p.Episodes).First().Guid);
 }