void generateChildnodes(bool recurse) { foreach (DirectoryInfo subdir in FileSystemPath.GetDirectories()) { DH_Node newNode = new DH_Node(subdir, Path + "/" + Name, FolderEngine, this, recurse); this.Children.Add(newNode); thisTreeNode.Nodes.Add(newNode.thisTreeNode); } }
public void generateTree(bool recursive = true) { rootNode = new DH_Node(new DirectoryInfo(folderPath), "", this, null, recursive); }
public DH_Node(DirectoryInfo _path, string _relativePath, DH_FolderEngine _folderEngine, DH_Node _parent, bool recurse) { Name = _path.Name; FileSystemPath = _path; Path = _relativePath; Children = new List<DH_Node>(); Parent = _parent; // this is null if we're the rootnode. FolderEngine = _folderEngine; thisTreeNode = new System.Windows.Forms.TreeNode(Name); if (recurse) { generateChildnodes(recurse); } refreshAttachments(); }