Пример #1
0
 /// <summary>
 /// Assigns a new treeview and parent node to specified nodes.
 /// </summary>
 /// <param name="nodes">The nodes that are assigned to the treeview.</param>
 /// <param name="treeview">The treeview or null to remove the treeview reference.</param>
 /// <param name="parentNode">The parent node.</param>
 void SetParents(IEnumerable <VirtualTreeNode> nodes, VirtualTreeView treeview = null, VirtualTreeNode parentNode = null)
 {
     if (nodes == null)
     {
         return;
     }
     foreach (var node in nodes)
     {
         node.TreeView = treeview;
         node.Parent   = (parentNode as TreeNode)?.Parent == null && IsRootCollection ? null : parentNode;
     }
 }
Пример #2
0
 /// <summary>
 /// Returns the number of child tree nodes.
 /// </summary>
 public new int GetNodeCount(bool includeSubTrees)
 {
     return(IsLoadedIntoTreeView
                         ? base.GetNodeCount(includeSubTrees)
                         : VirtualTreeView.GetNodeCount(Nodes, includeSubTrees));
 }
Пример #3
0
 /// <summary>
 /// Assigns a new treeview and parent node to specified nodes.
 /// </summary>
 /// <param name="node">The node that is assigned to the treeview.</param>
 /// <param name="treeview">The treeview or null to remove the treeview reference.</param>
 /// <param name="parentNode">The parent node.</param>
 void SetParents(VirtualTreeNode node, VirtualTreeView treeview = null, VirtualTreeNode parentNode = null)
 {
     SetParents(new[] { node }, treeview, parentNode);
 }