private void DrillTree(TreeNodeCollection tnc, string path, ref bool folderFound) { foreach (TreeNode tn in tnc) { if (!folderFound) { this.SelectedNode = tn; string tnPath = ShellOperations.GetFilePath(tn).ToUpper(cultureInfo); if (path == tnPath && !folderFound) { this.SelectedNode = tn; tn.EnsureVisible(); folderFound = true; break; } else if (path.IndexOf(tnPath) > -1 && !folderFound) { tn.Expand(); DrillTree(tn.Nodes, path, ref folderFound); } } } }
public string GetSelectedNodePath() { return(ShellOperations.GetFilePath(SelectedNode)); }