Beispiel #1
0
        // Returns a SimpleFileNode with all its children given the file/dir path
        public static SimpleFileNode loadFileTreeNode(String path)
        {
            SimpleFileNode fileTreeNode = new SimpleFileNode(path);

            //Console.WriteLine("TreeViewHandler > node: " + path);

            // CHILDREN
            if (fileTreeNode.IsDirectory)
            {
                // DIRECTORIES
                foreach (String childDir in Directory.GetDirectories(path))
                {
                    fileTreeNode.Children.Add(loadFileTreeNode(childDir));
                }
                // FILES
                foreach (String childFile in Directory.GetFiles(path))
                {
                    fileTreeNode.Children.Add(loadFileTreeNode(childFile));
                }
            }

            return(fileTreeNode);
        }
Beispiel #2
0
 // Loads the file tree of the given path to fileTreeRoot
 public static void loadFileTree(String rootPath)
 {
     // ROOT
     fileTreeRoot = loadFileTreeNode(rootPath);
 }