Ejemplo n.º 1
0
 public void InitFolderTreeView()
 {
     InitImageList();
     ShellOperations.PopulateTree(this, base.ImageList);
     if (this.Nodes.Count > 0)
     {
         this.Nodes[0].Expand();
     }
 }
Ejemplo n.º 2
0
 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);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public string GetSelectedNodePath()
 {
     return(ShellOperations.GetFilePath(SelectedNode));
 }
Ejemplo n.º 4
0
 private void TreeViewBeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     this.BeginUpdate();
     ShellOperations.ExpandBranch(e.Node, this.ImageList);
     this.EndUpdate();
 }