public void Presentation_Load(object sender, EventArgs e) { PodcastSerializer deserializer = new PodcastSerializer(); var podcast = deserializer.Deserialize(Environment.CurrentDirectory + "podcast.xml"); if (File.Exists(Environment.CurrentDirectory + "podcast.xml")) { foreach (var item in podcast) { var title = item.Titel; var category = item.Category; var url = item.URL; var episode = item.Episodes; var interval = item.UpdateInterval; Podcast podcasts = new Podcast() { Titel = title, Category = category, Episodes = episode, URL = url, UpdateInterval = interval }; Podcast.PodList.Add(podcasts); Category newCategory = new Category(category); Cate2.Add(newCategory); } } lstBoxCategories.DataSource = Cate2; lstBoxCategories.DisplayMember = "CateName"; Timer timerMin = new Timer(); timerMin.Tick += timerMinAsync; timerMin.Interval = 60000; timerMin.Start(); Timer timerHour = new Timer(); timerHour.Tick += timerHourAsync; timerHour.Interval = 3600000; timerHour.Start(); Timer timerDay = new Timer(); timerDay.Tick += timerDayAsync; timerDay.Interval = 216000000; timerDay.Start(); }
public static void SavePodcasts(List <Podcast> podcastListan) { PodcastSerializer.SavePodcasts(podcastListan); }
private void Inställningar_FormClosing(object sender, FormClosingEventArgs e) { PodcastSerializer serializer = new PodcastSerializer(); serializer.Serialize(Podcast.PodList); }
public static List <Podcast> GetPodcasts() { return(PodcastSerializer.GetPodcasts()); }