public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager) { if (!subscriptionView.IsEmpty()) { subscriptionView.SelectNode(subscriptionManager.Podcasts.SelectMany(p => p.Episodes).First().Guid); } }
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); } }
private void SelectFirstEpisode() { subscriptionView.SelectNode(podcasts.SelectMany(p => p.Episodes).First().Guid); }
public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager) { subscriptionView.SelectNode(subscriptionManager.Subscriptions.SelectMany(p => p.Episodes).First().Guid); }