Exemplo n.º 1
0
 /// <summary>
 /// Creates a new representation of a tree node.
 /// </summary>
 /// <param name="parent">The parent node of this node.</param>
 /// <param name="type">The type of this node, either 'element' or 'text'.</param>
 /// <param name="name">The name of this node (i.e. xml element type).</param>
 /// <param name="value">The value of this node (i.e. text data).</param>
 public Node(Node parent, string type, string name, string value)
 {
     this.p_Parent = parent;
     this.p_Type = type;
     this.p_Name = name;
     this.p_Value = value;
     this.p_Attributes = new Dictionary<string, string>();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new representation of a tree node.
        /// </summary>
        /// <param name="parent">The parent node of this node.</param>
        /// <param name="type">The type of this node, either 'element' or 'text'.</param>
        /// <param name="name">The name of this node (i.e. xml element type).</param>
        /// <param name="value">The value of this node (i.e. text data).</param>
        /// <param name="attributes">A dictionary of attributes associated with the node.</param>
        public Node(Node parent, string type, string name, string value, Dictionary<string, string> attributes)
        {
            if (attributes == null)
                throw new ArgumentException("The attributes argument must not be null.");

            this.p_Parent = parent;
            this.p_Type = type;
            this.p_Name = name;
            this.p_Value = value;
            this.p_Attributes = attributes;
        }