Beispiel #1
0
        public bool ParseNode(XmlNode node)
        {
            name = "m_" + node.Name;
            type = node.Name;

            foreach (XmlAttribute attr in node.Attributes)
            {
                m_fields.Add(ParseAttribute(attr));
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                if (child.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                var field = XmlBase.Parse(child);
                if (field.IsAttr)
                {
                    field.IsAttr      = false;
                    field.IsChildAttr = true;
                }
                m_fields.Add(field);
            }

            return(true);
        }
Beispiel #2
0
        protected static XmlBase ParseNormalNode(XmlNode node)
        {
            XmlBase target = ParseValue(node.InnerText);

            target.name   = "m_" + node.ParentNode.Name;
            target.IsAttr = false;
            return(target);
        }
Beispiel #3
0
        protected static XmlBase ParseAttribute(XmlAttribute attr)
        {
            XmlBase target = ParseValue(attr.Value);

            target.name   = "m_" + attr.OwnerElement.Name;
            target.IsAttr = true;
            return(target);
        }
Beispiel #4
0
        public bool ParseNode(XmlNode node)
        {
            name = "m_" + node.Name;

            foreach (XmlNode child in node.ChildNodes)
            {
                if (child.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                m_list.Add(XmlBase.Parse(child));
            }

            if (m_list.Count > 0)
            {
                type = string.Format("List<{0}>", m_list[0].type);
            }
            else
            {
                type = "List<object>";
            }

            return(true);
        }