Ejemplo n.º 1
0
        public ProjectFile(XmlDocument document)
        {
            XmlNode projectNode = document.SelectSingleNode("//project");
            XmlNode infoNode    = projectNode.SelectSingleNode("info");

            this.author      = infoNode.SelectSingleNode("author").InnerText;
            this.description = infoNode.SelectSingleNode("description").InnerText;
            this.version     = new Version(infoNode.SelectSingleNode("version").InnerText);

            XmlNode templatesNode = projectNode.SelectSingleNode("templates");
            string  templateName  = templatesNode.SelectSingleNode("template").InnerText;

            this.template = ProjectTemplates.GetTemplate(templateName);

            XmlNode mapInfoNode = projectNode.SelectSingleNode("mapinfo");

            this.mapName          = mapInfoNode.SelectSingleNode("name").InnerText;
            this.filename         = mapInfoNode.SelectSingleNode("filename").InnerText;
            this.uiText           = mapInfoNode.SelectSingleNode("uitext").InnerText;
            this.uiScreenShotFile = mapInfoNode.SelectSingleNode("uiscreenshot").InnerText;

            this.tags = new ProjectTagCollection();
            XmlNodeList taglistNodeList = projectNode.SelectNodes("taglist//tag");

            foreach (XmlNode tagNode in taglistNodeList)
            {
                string     templateID = tagNode.Attributes["template_id"].InnerText;
                string     path       = tagNode.InnerText;
                ProjectTag tag        = new ProjectTag(templateID, path);
                this.tags.Add(tag);
            }
        }
Ejemplo n.º 2
0
 public void Add(ProjectTag tag)
 {
     InnerList.Add(tag);
 }