using System; using System.Collections.Generic; [Serializable] public class XMLElement : IXMLNode { public XMLElement(string name, IXMLNode parent, List children, List attributes) { this.valueString = name; this.parentNode = parent; this.childList = children; this.attributeList = attributes; if (parent != null) { parent.Children.Add(this); } } public XMLElement(string name, IXMLNode parent, List children) { this.valueString = name; this.parentNode = parent; this.childList = children; this.attributeList = new List(); if (parent != null) { parent.Children.Add(this); } } public XMLElement(string name, IXMLNode parent) { this.valueString = name; this.parentNode = parent; this.childList = new List(); this.attributeList = new List(); if (parent != null) { parent.Children.Add(this); } } public string value { get { return this.valueString; } set { this.valueString = value; } } public XMLNodeType type { get { return XMLNodeType.Element; } } public IXMLNode Parent { get { return this.parentNode; } } public List Children { get { return this.childList; } set { this.childList = value; } } public List Attributes { get { return this.attributeList; } set { this.attributeList = value; } } protected string valueString; protected IXMLNode parentNode; protected List childList; protected List attributeList; }