+2007-09-29 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * FolderBrowserDialog.cs: Fix the recursive FindPathInNodes method.
+ Also remove the stack.Count > 0 check in FBTreeView.SetSelectedNode
+ method, since it causes the dialog to not select folders directly
+ under the root path (when setting SelectedPath property).
+
2007-09-29 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* TreeNode.cs: When calling Expand/Collapse and need to call
}
}
- if (stack.Count > 0) {
- FillNode (node);
- node.Expand ();
-
- // walk through the subdirs and fill the nodes
- while (stack.Count > 0) {
- string part_name = stack.Pop () as string;
-
- foreach (TreeNode treeNode in node.Nodes) {
- FBTreeNode fbnode = treeNode as FBTreeNode;
-
- if (path_cut + part_name == fbnode.RealPath) {
- node = fbnode;
- path_cut += part_name;
-
- FillNode (node);
- node.Expand ();
- break;
- }
- }
- }
-
- // finally find the node for the complete path
+ FillNode (node);
+ node.Expand ();
+
+ // walk through the subdirs and fill the nodes
+ while (stack.Count > 0) {
+ string part_name = stack.Pop () as string;
+
foreach (TreeNode treeNode in node.Nodes) {
FBTreeNode fbnode = treeNode as FBTreeNode;
-
- if (path == fbnode.RealPath) {
+
+ if (path_cut + part_name == fbnode.RealPath) {
node = fbnode;
+ path_cut += part_name;
+
+ FillNode (node);
+ node.Expand ();
break;
}
}
}
+
+ // finally find the node for the complete path
+ foreach (TreeNode treeNode in node.Nodes) {
+ FBTreeNode fbnode = treeNode as FBTreeNode;
+
+ if (path == fbnode.RealPath) {
+ node = fbnode;
+ break;
+ }
+ }
}
if (node != null) {
return fbnode;
}
- return FindPathInNodes (path, node.Nodes);
+ FBTreeNode n = FindPathInNodes (path, node.Nodes);
+ if (n != null)
+ return n;
}
return null;