private void MainFormViewOnFormClosed(object sender, FormClosedEventArgs formClosedEventArgs)
 {
     EventAggregator.Instance.Publish(new ApplicationClosingMessage());
     // TODO: wait for all views to publish
     subscriptionManager.Save();
     podcastPlayer.Dispose();
 }
Exemple #2
0
        public EpisodePresenter(IEpisodeView episodeView, IPodcastPlayer podcastPlayer)
        {
            this.episodeView              = episodeView;
            this.podcastPlayer            = podcastPlayer;
            episodeView.Title             = "";
            episodeView.PublicationDate   = "";
            this.episodeView.NoteCreated += EpisodeViewOnNoteCreated;
            episodeView.PositionChanged  += (s, a) => podcastPlayer.PositionInSeconds = episodeView.PositionInSeconds;

            var timer = new Timer {
                Interval = 100
            };

            timer.Tick += TimerOnTick;
            timer.Start();

            EventAggregator.Instance.Subscribe <EpisodeSelectedMessage>(OnEpisodeSelected);
            EventAggregator.Instance.Subscribe <PodcastSelectedMessage>(OnPodcastSelected);
            EventAggregator.Instance.Subscribe <ApplicationClosingMessage>(m =>
            {
                SaveEpisode();
                podcastPlayer.Dispose();
            });
            EventAggregator.Instance.Subscribe <PeaksAvailableMessage>(OnPeaksAvailable);
        }
Exemple #3
0
 private void MainFormViewOnFormClosed(object sender, FormClosedEventArgs formClosedEventArgs)
 {
     SaveEpisode();
     subscriptionManager.Save();
     podcastPlayer.Dispose();
 }
 private void OnMainFormClosed(object sender, FormClosedEventArgs e)
 {
     SaveEpisode();
     _subscriptionManager.SavePodcasts(_podcasts);
     _podcastPlayer.Dispose();
 }