public void InitFolderTreeView() { InitImageList(); ShellOperations.PopulateTree(this, base.ImageList); if (this.Nodes.Count > 0) { this.Nodes[0].Expand(); } }
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)); }
private void TreeViewBeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e) { this.BeginUpdate(); ShellOperations.ExpandBranch(e.Node, this.ImageList); this.EndUpdate(); }