예제 #1
0
        private void lvEpisodes_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvPodcasts.SelectedItems == null || lvPodcasts.SelectedItems.Count == 0)
            {
                return;
            }
            else
            {
                if (lvEpisodes.SelectedItems == null || lvEpisodes.SelectedItems.Count == 0)
                {
                    return;
                }
                else
                {
                    string selectedPodcast = lvPodcasts.SelectedItems[0].Text;
                    var    podcast         = ListHandler.FetchPodcast(selectedPodcast);
                    string selectedEpisode = lvEpisodes.SelectedItems[0].Text;
                    string episode         = ListHandler.FetchEpisode(selectedEpisode, podcast);
                    lbEpisodeTitle.Text = selectedEpisode;
                    string episodeNoHTML = Regex.Replace(episode, "<.*?>", String.Empty);
                    tbEpsiodeDescription.Text = episodeNoHTML;

                    return;
                }
            }
        }
예제 #2
0
        private void btnSavePodcast_Click(object sender, EventArgs e)
        {
            var oldPodcast = ListHandler.FetchPodcast(lvPodcasts.SelectedItems[0].Text);
            var newPodcast = new Podcast(
                tbPodcastURL.Text,
                tbPodcastTitle.Text,
                int.Parse(cbPodcastInterval.SelectedItem.ToString()),
                cbPodcastCategory.SelectedItem.ToString());

            if (ListHandler.UpdatePodcast(oldPodcast, newPodcast))
            {
                tbPodcastTitle.Text             = "";
                tbPodcastURL.Text               = "";
                cbPodcastInterval.SelectedIndex = 0;
                cbPodcastCategory.SelectedIndex = 0;
                PodcastButtons(false);
                FillPodcastListBox();
            }
        }
예제 #3
0
 private void lvPodcasts_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvPodcasts.SelectedItems == null || lvPodcasts.SelectedItems.Count == 0)
     {
         return;
     }
     else
     {
         string selectedPodcast = lvPodcasts.SelectedItems[0].Text;
         var    podcast         = ListHandler.FetchPodcast(selectedPodcast);
         tbPodcastTitle.Text    = podcast.Title;
         tbPodcastURL.Text      = podcast.URL;
         cbPodcastInterval.Text = podcast.UpdateInterval.ToString();
         cbPodcastCategory.Text = podcast.Category.ToString();
         FillVEpisodes(podcast);
         PodcastButtons(true);
         return;
     }
 }