Esempio n. 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);
 }
Esempio n. 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);
     }
 }
Esempio n. 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);
 }
Esempio n. 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);
 }