Exemplo n.º 1
0
 public void SparaPodcast(string pTitel)
 {
     foreach (var pod in PodcastLista.hamtaLista().Where(p => p.PodcastTitel.Equals(pTitel)))
     {
         tbUrl.Text = pod.Url;
         cbUpdFreq.SelectedIndex  = cbUpdFreq.Items.IndexOf(pod.UppdateringsFrekvens + " minuter");
         cbKategori.SelectedIndex = cbKategori.Items.IndexOf(pod.Kategori);
     }
 }
Exemplo n.º 2
0
 public static void SparaListaPodcast()
 {
     if (File.Exists("podcasts.txt"))
     {
         File.Delete("podcasts.txt");
     }
     using (Stream stream = File.OpenWrite(Environment.CurrentDirectory + "\\podcasts.txt"))
     {
         XmlSerializer xmlSer = new XmlSerializer(typeof(List <Podcast>));
         xmlSer.Serialize(stream, PodcastLista.hamtaLista());
         stream.Close();
     }
 }
Exemplo n.º 3
0
        public void UpdatePodcastListviewKategori(string kategori)
        {
            List <Podcast> lista = PodcastLista.hamtaLista();

            lvPodcasts.Items.Clear();

            foreach (var pod in lista.Where(p => p.Kategori == kategori))
            {
                var list = new ListViewItem(new[]
                {
                    pod.PodcastTitel,
                    pod.Kategori,
                    pod.AntalAvsnitt.ToString(),
                    pod.UppdateringsFrekvens.ToString() + " minuter"
                });
                lvPodcasts.Items.Add(list);
            }
        }