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; } } }
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(); } }
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; } }