Esempio n. 1
0
        public SXNode(SXNode parent, string name, string value)
        {
            this.Initialize(parent);

            this.name = name;
            this.value = value;
        }
Esempio n. 2
0
 protected SXNode(XmlReader reader, SXNode parent)
 {
     this.Initialize(reader, parent);
 }
Esempio n. 3
0
 protected void Initialize(SXNode parent_node)
 {
     this.parent = parent_node;
 }
Esempio n. 4
0
        protected bool Initialize(XmlReader reader, SXNode parent_node)
        {
            if (!reader.IsStartElement())
                return false;

            this.parent = parent_node;

            this.prefix = reader.Prefix;
            this.name = reader.LocalName;

            bool empty_element = reader.IsEmptyElement;

            while (reader.MoveToNextAttribute())
                this.attributes.Add(new SXAttribute(reader));

            if (!empty_element)
                while (reader.Read())
                {
                    if (reader.IsStartElement())
                        this.nodes.Add(new SXNode(reader, this));
                    else if (reader.NodeType == XmlNodeType.Text)
                        this.value = reader.Value;
                    else if (reader.NodeType == XmlNodeType.EndElement)
                        break;
                }

            return true;
        }
Esempio n. 5
0
 public SXNode AddNode(string name, string value)
 {
     SXNode node = new SXNode(this, name, value);
     this.Nodes.Add(node);
     return node;
 }