Exemplo n.º 1
0
        private void buildXmlData(string section, XmlStringBuilder xml)
        {
            var sections = new List <string>();

            sections.AddRange(Data.GetSubSections(section));

            foreach (string s in sections)
            {
                int depth = s.Substring(section.Length).Split('\\').Length - 1;
                if (depth == 1)
                {
                    xml.openSubSection(Data.GetSubsectionName(s));
                    buildXmlData(s, xml);
                    xml.closeSubSection();
                }
            }

            if (!String.IsNullOrEmpty(section))
            {
                foreach (var p in Data.GetValues(section))
                {
                    xml.addValue(p.Key, p.Value);
                }
            }
        }
Exemplo n.º 2
0
        private string buildXmlData()
        {
            var xml = new XmlStringBuilder();

            xml.openSubSection("DataStorage");

            buildXmlData("", xml);

            xml.closeSubSection();
            return(xml.ToString());
        }