|
- using System;
- using System.Collections.Generic;
-
- [Serializable]
- public class XMLElement : IXMLNode
- {
- public XMLElement(string name, IXMLNode parent, List<IXMLNode> children, List<XMLAttribute> 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<IXMLNode> children)
- {
- this.valueString = name;
- this.parentNode = parent;
- this.childList = children;
- this.attributeList = new List<XMLAttribute>();
- if (parent != null)
- {
- parent.Children.Add(this);
- }
- }
-
- public XMLElement(string name, IXMLNode parent)
- {
- this.valueString = name;
- this.parentNode = parent;
- this.childList = new List<IXMLNode>();
- this.attributeList = new List<XMLAttribute>();
- 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<IXMLNode> Children
- {
- get
- {
- return this.childList;
- }
- set
- {
- this.childList = value;
- }
- }
-
- public List<XMLAttribute> Attributes
- {
- get
- {
- return this.attributeList;
- }
- set
- {
- this.attributeList = value;
- }
- }
-
- protected string valueString;
-
- protected IXMLNode parentNode;
-
- protected List<IXMLNode> childList;
-
- protected List<XMLAttribute> attributeList;
- }
|