public CsFile[] CsFiles() { if (_csFilesCache != null) { return(_csFilesCache); } var dir = Path.GetDirectoryName(Filepath); _csFilesCache = new Librarian(_csFilesPattern, Text) .Get("capturegroup") .Select(csFileRelPath => System.IO.Path.Combine(dir, csFileRelPath)) .Where(File.Exists) .Select(file => CsFile.Get(file)) .ToArray(); return(_csFilesCache); }
public static IEnumerable <CsFile> GetCsFiles(string dir) { return(Directory.EnumerateFiles(dir, "*.cs", SearchOption.AllDirectories) .Select(file => CsFile.Get(file))); }