public GetFolders ( string folder, string filter ) : IEnumerable |
||
folder | string | |
filter | string | |
Результат | IEnumerable |
private TreeNodeCollection AddFolders(string parent, FormDataCollection queryStrings) { var pickerApiController = new FilePickerApiController(); var filter = queryStrings.Get("filter").Split(',').Select(a => a.Trim().EnsureStartsWith(".")).ToArray(); var treeNodeCollection = new TreeNodeCollection(); treeNodeCollection.AddRange(pickerApiController.GetFolders(parent,filter) .Select(dir => CreateTreeNode(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), "~/" + parent, queryStrings, dir.Name, "icon-folder", filter[0]=="." ? dir.EnumerateDirectories().Any() || pickerApiController.GetFiles(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), filter).Any() : pickerApiController.GetFiles(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), filter).Any()))); return treeNodeCollection; }
private TreeNodeCollection AddFolders(string parent, FormDataCollection queryStrings) { var pickerApiController = new FilePickerApiController(); var filter = queryStrings.Get("filter").Split(',').Select(a => a.Trim().EnsureStartsWith(".")).ToArray(); var treeNodeCollection = new TreeNodeCollection(); treeNodeCollection.AddRange(pickerApiController.GetFolders(parent, filter) .Select(dir => CreateTreeNode(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), "~/" + parent, queryStrings, dir.Name, "icon-folder", filter[0] == "." ? dir.EnumerateDirectories().Any() || pickerApiController.GetFiles(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), filter).Any() : pickerApiController.GetFiles(dir.FullName.Replace(IOHelper.MapPath("~"), "").Replace("\\", "/"), filter).Any()))); return(treeNodeCollection); }