Exemple #1
0
        /// <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());
        }