Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Location">Location of the OPML file</param>
 public OPML(string Location)
 {
     if (string.IsNullOrEmpty(Location))
         throw new ArgumentNullException("Location");
     XmlDocument Document = new XmlDocument();
     Document.Load(Location);
     foreach (XmlNode Children in Document.ChildNodes)
     {
         if (Children.Name.Equals("opml", StringComparison.CurrentCultureIgnoreCase))
         {
             foreach (XmlElement Child in Children.ChildNodes)
             {
                 if (Child.Name.Equals("body", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Body = new Body(Child);
                 }
                 else if (Child.Name.Equals("head", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Head = new Head(Child);
                 }
             }
         }
     }
 }
Пример #2
0
 public OPML(XmlDocument Document)
 {
     if (Document == null)
         throw new ArgumentNullException("Document");
     foreach (XmlNode Children in Document.ChildNodes)
     {
         if (Children.Name.Equals("opml", StringComparison.CurrentCultureIgnoreCase))
         {
             foreach (XmlElement Child in Children.ChildNodes)
             {
                 if (Child.Name.Equals("body", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Body = new Body(Child);
                 }
                 else if (Child.Name.Equals("head", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Head = new Head(Child);
                 }
             }
         }
     }
 }