<summary>
Enumerates all the nodes in the tree.
</summary>
<param name= "Tree" ></param>
<returns></returns>
Public IList getchecknodes (treelist tree)
{
Used to store the selected nodes.
IList list = new ArrayList ();
The head loop gets the selected root node.
foreach (Treelistnode n in tree. Nodes)
{
if (n.checked) list. ADD (New Mynodeitem (n, "root directory")); Checked indicates that the check box
if (n.checked)
{
List. ADD (n); Checked indicates that the check box
Break
}
If the current node has a child node set, then all child nodes are enumerated.
if (N.nodes.count > 0)
This. Dogetchecknodes (list, n);
}
return list;
}
<summary>
Shave, scan all nodes.
</summary>
<param name= "List" ></param>
<param name= "ParentNode" ></param>
private void Dogetchecknodes (IList list, Treelistnode parentnode)
{
Enumerates all child nodes of the current node
foreach (Treelistnode n in Parentnode.nodes)
{
if (n.checked)
{
List. ADD (n);
Break
}
If the current node has a child node set, then all child nodes are enumerated.
if (N.nodes.count > 0)
This. Dogetchecknodes (list, n);
}
}
Recursive tree treelist