Example #1
0
        public static UrlSet Deserialize(string path)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(UrlSet));

            StreamReader reader = new StreamReader(path);

            UrlSet xml = (UrlSet)serializer.Deserialize(reader);

            reader.Close();
            reader.Dispose();

            return(xml);
        }
 private void BuildUrlSet(List<Url> urls, int sequence)
 {
     this._SitemapNames.Add(String.Format("{0}{1}.xml", this.SitemapName, sequence + 1));
     var urlSet = new UrlSet();
     urlSet.UrlList.AddRange(urls);
     urlSet.Serialize(Path.Combine(SitemapPath, String.Format("{0}{1}.xml", this.SitemapName, sequence + 1)));
 }