/// <summary> /// Returns a recursive list of all files in the specified path with the specified extension. /// </summary> public string[] GetFileList(string path, string extension, bool recursive) { // Get the references. string[] results = references.GetFileList(path, extension, recursive); List <string> resultsList = new List <string>(results); // Add all project references from the template tag list (if they aren't already in the list). if (!recursive) { FolderEntry entry = templates.TemplateTagHierarchy.LocateFolderByPath(path); if (entry != null) { string[] entries = entry.FileList(); foreach (string filename in entries) { if (extension == "*" || filename.EndsWith(extension)) { resultsList.Add(filename); } } } } else { resultsList.AddRange(templates.TemplateTagHierarchy.GetRecursiveFileList(path)); } return(resultsList.ToArray()); }
/// <summary> /// Returns a list of referenced files located under the specified path with the specified extension, /// optionally recursively returning all results from child folders under the path as well. /// </summary> public string[] GetFileList(string path, string extension, bool recursive) { // Make sure that the path we are looking in exists. FolderEntry folder = projectReferencesTable.LocateFolderByPath(path); if (folder == null) { return(new string[0]); } // Get the results. if (recursive) { return(folder.GetRecursiveFileList()); } else { return(folder.FileList()); } }