示例#1
0
 private void FillSection(TreeNode root, SectionBase section)
 {
     foreach (string subSectionName in section.Keys)
     {
         SectionBase subSection = section[subSectionName];
         if (subSection != null)
         {
             TreeNode node = root.Nodes.Add(subSectionName);
             node.Name = subSectionName;
             node.Tag = subSection;
             FillSection(node, subSection);
         }
     }
 }
示例#2
0
        private static XElement SerializeSectionBase(SectionBase section, XElement xSectionBase)
        {
            foreach (string subSectionName in section.Keys)
            {
                Sections subSection = section[subSectionName];
                if (subSection != null)
                {
                    XElement xSubSection = SerializeSection(subSection, subSectionName);
                    xSectionBase.Add(xSubSection);
                }
            }

            foreach (string parameterKey in section.Parameters.Keys)
            {
                XElement xParam = new XElement("param");
                xParam.SetAttributeValue("name", parameterKey);
                xParam.Value = section.Parameters[parameterKey];
                xSectionBase.Add(xParam);
            }

            return xSectionBase;
        }