示例#1
0
 /// <summary>
 /// Adds the elements of a treenodes collection to  the end of an existing treenodes collection.
 /// </summary>
 /// <param name="treenodes">A collection of treenodes to add to the existing collection of treenodes.</param>
 public void AddRange(TreeNodes treenodes)
 {
     if (treenodes == null || treenodes.Count == 0)
     {
         return;
     }
     // share the current instance with the added treenodes collection
     treenodes.Parent = _parent;
     InnerList.AddRange(treenodes);
 }
示例#2
0
 /// <summary>
 /// Creates a new instance of a tree node.
 /// </summary>
 /// <param name="parent">The parent of the node to create.</param>
 /// <param name="Value">The value stored at the tree node.</param>
 /// <param name="children">The children of the tree node.</param>
 public TreeNode(ITreeNode parent, object Value, TreeNodes children)
 {
     _parent = parent;
     _value  = Value;
     if (children != null)
     {
         _nodes        = children;
         _nodes.Parent = this;
     }
     else
     {
         _nodes = new TreeNodes(this);
     }
 }
示例#3
0
 /// <summary>
 /// Creates a new instance of a tree node.
 /// </summary>
 /// <param name="parent">The parent of the node to create.</param>
 /// <param name="Value">The value stored at the tree node.</param>
 /// <param name="children">The children of the tree node.</param>
 public TreeNode(ITreeNode parent, object Value, TreeNodes children)
 {
     _parent = parent;
     _value = Value;
     if (children != null)
     {
         _nodes = children;
         _nodes.Parent = this;
     }
     else
         _nodes = new TreeNodes(this);
 }
示例#4
0
 /// <summary>
 /// Adds the elements of a treenodes collection to  the end of an existing treenodes collection.
 /// </summary>
 /// <param name="treenodes">A collection of treenodes to add to the existing collection of treenodes.</param>
 public void AddRange(TreeNodes treenodes)
 {
     if (treenodes == null || treenodes.Count == 0) return;
     // share the current instance with the added treenodes collection
     treenodes.Parent = _parent;
     InnerList.AddRange(treenodes);
 }