Example #1
0
        public static NodeFoldersFile LoadTreeFiles(string path)
        {
            NodeFoldersFile root = new NodeFoldersFile(path);

            AddFilesToNode(root);
            return(root);
        }
Example #2
0
 static void AddFilesToNode(NodeFoldersFile root)
 {
     if (!root.isFolder)
     {
         return;
     }
     string[] filleList = System.IO.Directory.GetFiles(root.Name);
     foreach (string file in filleList)
     {
         root.Child.Add(new NodeFoldersFile(file, root, false));
     }
     string[] dir = System.IO.Directory.GetDirectories(root.Name);
     foreach (string p in dir)
     {
         NodeFoldersFile dirNode = new NodeFoldersFile(p, root);
         AddFilesToNode(dirNode);
     }
 }
Example #3
0
 public NodeFoldersFile(string name, NodeFoldersFile prn = null, bool isFld = true)
 {
     Name     = name;
     isFolder = isFld;
     parent   = prn;
 }