コード例 #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;
     }
 }