Ejemplo n.º 1
0
 public void LoadFromFile(string name)
 {
     //form.textBox1.Text = "HEHE";
     feedList = new List <Podcast>();
     foreach (string file in Directory.EnumerateFiles(path, name + ".xml"))
     {
         XmlReaderSettings settings = new XmlReaderSettings();
         settings.DtdProcessing = DtdProcessing.Parse;
         XmlReader       reader = XmlReader.Create(file, settings);
         SyndicationFeed feed   = SyndicationFeed.Load(reader);
         reader.Close();
         foreach (SyndicationItem item in feed.Items)
         {
             var podcast = Podcast.CreateNewObject(item.Title.Text, item.Summary.Text, "", "", "", "");
             feedList.Add(podcast);
         }
     }
 }
Ejemplo n.º 2
0
 public void LoadFromFile(string url, string name, string category, string updateTime)
 {
     feedList = new List <Podcast>();
     if (ExceptionHandler.CheckNullException(url) && ExceptionHandler.CheckExceptionStringNumber(updateTime) && ExceptionHandler.CheckNullExceptionDot(name) && ExceptionHandler.CheckNullExceptionDot(category))
     {
         foreach (string file in Directory.EnumerateFiles(path, "*.xml"))
         {
             XmlReaderSettings settings = new XmlReaderSettings();
             settings.DtdProcessing = DtdProcessing.Parse;
             XmlReader       reader = XmlReader.Create(file, settings);
             SyndicationFeed feed   = SyndicationFeed.Load(reader);
             reader.Close();
             foreach (SyndicationItem item in feed.Items)
             {
                 var podcast = Podcast.CreateNewObject(item.Title.Text, item.Summary.Text, "", "", "", "");
                 feedList.Add(podcast);
             }
         }
     }
 }