コード例 #1
0
 private void SummaryPlayStartClicked(object sender, RoutedEventArgs e)
 {
     if ((sender as Button)?.DataContext is PodcastEpisodeView kvp)
     {
         PodcastFunctions.PlayFile(kvp, true).ConfigureAwait(false);
     }
 }
コード例 #2
0
        private void SearchPodcastsClicked(object sender, RoutedEventArgs e)
        {
            var res = PodcastFunctions.SearchPodcasts(searchData.SearchString);

            searchData.SearchResults.Clear();
            searchData.SearchResults = res;
        }
コード例 #3
0
 private void WindowClosing(object sender, CancelEventArgs e)
 {
     FileDownloader.Kill();
     VlcApi.Kill();
     PodcastFunctions.Kill();
     WindowPlacementHandler.GetPlacement(new WindowInteropHelper(this).Handle);
 }
コード例 #4
0
 private void TimeSliderMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (sender is Slider slider)
     {
         sliderData.MovingTimeSlider = false;
         PodcastFunctions.SeekFile(slider.Value).ConfigureAwait(false);
     }
 }
コード例 #5
0
 private void SearchPodcastKeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter && sender is TextBox textBox)
     {
         var res = PodcastFunctions.SearchPodcasts(textBox.Text);
         searchData.SearchResults.Clear();
         searchData.SearchResults = res;
     }
 }
コード例 #6
0
 private void DownloadRecentClicked(object sender, RoutedEventArgs e)
 {
     if ((sender as Button)?.DataContext is PodcastEpisodeView kvp)
     {
         var podcast = config.ConfigObject.PodcastMap.Podcasts.FirstOrDefault(x => x.Value.PrimaryName == kvp.PrimaryName).Value;
         var ep      = kvp.Episode.EpisodeNumber;
         if (podcast == null)
         {
             return;
         }
         PodcastFunctions.DownloadEpisode(ep, podcast).ConfigureAwait(false);
     }
 }
コード例 #7
0
        private void OnFinishDownloading(bool res, int ep, string shortCode)
        {
            if (ShortCode != shortCode)
            {
                return;
            }
            var episodeToUse = _episodes[ep];

            episodeToUse.IsDownloaded = res;
            Config.Instance.SaveConfig();
            FileDownloader.OnDownloadFinishedEvent -= OnFinishDownloading;
            PodcastFunctions.UpdateLatestPodcastList().ConfigureAwait(false);
        }
コード例 #8
0
        public async Task InitializePodcasts()
        {
            isLoading = true;
            foreach (var pod in config.ConfigObject.PodcastMap.Podcasts)
            {
                await pod.Value.CheckForNew();

                await pod.Value.FillNewEpisodes();

                await pod.Value.CheckForDownloadedEpisodes();
            }
            await PodcastFunctions.UpdateLatestPodcastList().ConfigureAwait(false);

            await PodcastFunctions.UpdateLatestPlayedList().ConfigureAwait(false);

            errorData.Error = "";
            VlcApi.DoNothing();
            isLoading = false;
        }
コード例 #9
0
 private void StopClicked(object sender, RoutedEventArgs e)
 {
     PodcastFunctions.StopCommand().ConfigureAwait(false);
 }