Ejemplo n.º 1
0
        public void Save()
        {
            XmlDocument doc      = new XmlDocument();
            var         projelem = doc.CreateElement("CodeWalkerProject");

            doc.AppendChild(projelem);

            Xml.AddChildWithInnerText(doc, projelem, "Name", Name);
            Xml.AddChildWithAttribute(doc, projelem, "Version", "value", Version.ToString());

            var ymapselem = Xml.AddChild(doc, projelem, "YmapFilenames");

            foreach (string ymapfilename in YmapFilenames)
            {
                Xml.AddChildWithInnerText(doc, ymapselem, "Item", ymapfilename);
            }

            var ytypselem = Xml.AddChild(doc, projelem, "YtypFilenames");

            foreach (string ytypfilename in YtypFilenames)
            {
                Xml.AddChildWithInnerText(doc, ytypselem, "Item", ytypfilename);
            }

            var yndselem = Xml.AddChild(doc, projelem, "YndFilenames");

            foreach (string yndfilename in YndFilenames)
            {
                Xml.AddChildWithInnerText(doc, yndselem, "Item", yndfilename);
            }

            var ynvselem = Xml.AddChild(doc, projelem, "YnvFilenames");

            foreach (string ynvfilename in YnvFilenames)
            {
                Xml.AddChildWithInnerText(doc, ynvselem, "Item", ynvfilename);
            }

            var trainselem = Xml.AddChild(doc, projelem, "TrainsFilenames");

            foreach (string trainsfile in TrainsFilenames)
            {
                Xml.AddChildWithInnerText(doc, trainselem, "Item", trainsfile);
            }

            var scenarioselem = Xml.AddChild(doc, projelem, "ScenarioFilenames");

            foreach (string scenariofilename in ScenarioFilenames)
            {
                Xml.AddChildWithInnerText(doc, scenarioselem, "Item", scenariofilename);
            }

            doc.Save(Filepath);
        }