コード例 #1
0
        public static NodeFoldersFile LoadTreeFiles(string path)
        {
            NodeFoldersFile root = new NodeFoldersFile(path);

            AddFilesToNode(root);
            return(root);
        }
コード例 #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);
     }
 }
コード例 #3
0
 public NodeFoldersFile(string name, NodeFoldersFile prn = null, bool isFld = true)
 {
     Name     = name;
     isFolder = isFld;
     parent   = prn;
 }