Exemple #1
0
        public void Save(string file)
        {
            XmlDocument doc  = new XmlDocument();
            XmlElement  root = doc.CreateElement("root");

            XmlElement version = doc.CreateElement("version");

            version.InnerText = this.version;

            XmlElement resUrl = doc.CreateElement("resUrl");

            resUrl.InnerText = this.resUrl;

            XmlElement resVersion = doc.CreateElement("resVersion");

            if (this.resVersions != null)
            {
                for (int i = 0; i < this.resVersions.Count; i++)
                {
                    ResVersion curResVersion = this.resVersions[i];
                    XmlElement resItem       = doc.CreateElement("res");
                    resItem.SetAttribute("version", curResVersion.version);
                    resItem.SetAttribute("url", curResVersion.url);
                    resItem.SetAttribute("md5", "");
                    resItem.SetAttribute("size", curResVersion.size.ToString());
                    resVersion.AppendChild(resItem);
                }
            }

            root.AppendChild(version);
            root.AppendChild(resUrl);
            root.AppendChild(resVersion);

            doc.AppendChild(root);

            doc.Save(file);
        }
Exemple #2
0
 public void AddResVersion(ResVersion version)
 {
     this.resVersions.Add(version);
 }