BlogEngine.Core.Providers.XmlFileSystemProvider.GetFiles C# (CSharp) Method

GetFiles() public method

gets all the files in a directory, only searches one level
public GetFiles ( FileSystem BaseDirectory ) : IEnumerable
BaseDirectory System.IO.FileSystem the base directory
return IEnumerable
        public override IEnumerable<FileSystem.File> GetFiles(FileSystem.Directory BaseDirectory)
        {
            var aPath = BlogAbsolutePath(BaseDirectory.FullPath);
            var sysDirectory = new DirectoryInfo(aPath);
            return sysDirectory.GetFiles().Select(x => GetFile(string.Format("{0}/{1}", BaseDirectory.FullPath, x.Name)));
        }

Usage Example

        /// <summary>
        /// Get stats info
        /// </summary>
        /// <returns>Stats counters</returns>
        public List<FileSystem.File> Get()
        {
            List<FileSystem.File> files = new List<FileSystem.File>();
            XmlFileSystemProvider pr = new XmlFileSystemProvider();
            var dir = BlogService.GetDirectory("~/");
            files = pr.GetFiles(dir).ToList();
            return files;

        }