private async void OnSelectedEpisodeChanged(object sender, EventArgs e)
        {
            podcastPlayer.UnloadEpisode();
            if (subscriptionView.SelectedNode == null)
            {
                return;
            }

            var selectedEpisode = subscriptionView.SelectedNode.Tag as Episode;

            if (selectedEpisode != null)
            {
                EventAggregator.Instance.Publish(new EpisodeSelectedMessage(selectedEpisode));
                mainFormView.ShowEpisodeView();
                SaveEpisode();
                currentEpisode              = selectedEpisode;
                episodeView.Title           = currentEpisode.Title;
                episodeView.PublicationDate = currentEpisode.PubDate;
                episodeView.Description     = currentEpisode.Description;
                //toolbarView.EpisodeIsFavourite = currentEpisode.IsFavourite; now handled by the IsFavouriteCommand
                currentEpisode.IsNew = false;
                episodeView.Rating   = currentEpisode.Rating;
                episodeView.Tags     = String.Join(",", currentEpisode.Tags ?? new string[0]);
                episodeView.Notes    = currentEpisode.Notes ?? "";
                podcastPlayer.LoadEpisode(currentEpisode);
                if (currentEpisode.Peaks == null || currentEpisode.Peaks.Length == 0)
                {
                    episodeView.SetPeaks(null);
                    currentEpisode.Peaks = await podcastPlayer.LoadPeaksAsync();
                }
                episodeView.SetPeaks(currentEpisode.Peaks);
            }
            var selectedPodcast = subscriptionView.SelectedNode.Tag as Podcast;

            if (selectedPodcast != null)
            {
                EventAggregator.Instance.Publish(new PodcastSelectedMessage(selectedPodcast));
                mainFormView.ShowPodcastView();
                podcastView.SetPodcastTitle(selectedPodcast.Title);
                podcastView.SetEpisodeCount(String.Format("{0} episodes", selectedPodcast.Episodes.Count));
                podcastView.SetPodcastUrl(selectedPodcast.Link);
            }
        }
Esempio n. 2
0
 private void OnPodcastSelected(PodcastSelectedMessage message)
 {
     podcastView.SetPodcastTitle(message.Podcast.Title);
     podcastView.SetEpisodeCount(String.Format("{0} episodes", message.Podcast.Episodes.Count));
     podcastView.SetPodcastUrl(message.Podcast.Link);
 }