/// <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); }
/// <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); } }
/// <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); }
/// <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); }