static void Main() { var podcast = new Podcast("giant", "bomb", 1, "", "", default); var podcasts = new List<Podcast>(); podcasts.Add(podcast); PodcastRepo.SavePodcasts(podcasts); podcasts = PodcastRepo.LoadPodcasts(); //var giantBomb = podcasts.Where(podcast => podcast.Title == "abc").FirstOrDefault(); //if (giantBomb != null) //{ // // we have found giantbomb // var latestEpisode = giantBomb.EpisodeList.OrderByDescending(episode => episode.PubDate).FirstOrDefault(); //} //var gamingPodcasts = podcasts.Where(podcast => podcast.Category == "gaming").ToList(); //var giantBomb2 = (from podcast in podcasts // where podcast.Title == "giant" // select podcast) // .FirstOrDefault(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
static public void addPodcast(string url, string category, int interval) { var podcast = RssReader.GetPodcastFromURL(url, category, interval); int iteration = 0; if (podcastList.Count() > 0) { foreach (var podcastInList in podcastList) { iteration++; if (lookupTrue(podcastInList.Title, "podcast")) { MessageBox.Show("Podcasten är redan inläst"); } else if (!lookupTrue(podcastInList.Title, "podcast") && podcastList.Count() == iteration) { podcastList.Add(podcast); PodcastRepo.SavePodcasts(podcastList); } } } else { podcastList.Add(podcast); PodcastRepo.SavePodcasts(podcastList); } }
public static void saveData(string repo) { switch (repo) { case "pod": PodcastRepo.SavePodcasts(podcastList); break; case "cat": CategoryRepo.SaveCategories(categoryList); break; default: CategoryRepo.SaveCategories(categoryList); PodcastRepo.SavePodcasts(podcastList); break; } }
static public void removePodcast(int podcastIndex) { podcastList.RemoveAt(podcastIndex); PodcastRepo.SavePodcasts(podcastList); }