public ascx_FolderView loadFolder(TreeNode treeNode, string path) { "Loading Folder: {0}".info(path); if (path.valid()) { FolderView.beginUpdate(); path = Environment.ExpandEnvironmentVariables(path); // in case there are Environment variables like %SystemDrive% //"There are {0} files {0}".info(path.files().size()); //"There are {0} folders {0}".info(path.folder.folders().size()); var folders = path.folders().sort(); foreach (var folder in folders) { treeNode.add_Node(folder.fileName(), folder, folder.files().size() > 0 || folder.folders().size() > 0) .color(Color.DarkOrange); } var files = path.files(); treeNode.add_Nodes(files, (file) => file.fileName(), (file) => file, (file) => false, (file) => Color.DarkBlue); FolderView.endUpdate(); } return(this); }