Example #1
0
        public static CsFile Get(string path)
        {
            CsFile result;

            if (!CsFilePool.TryGetValue(path, out result))
            {
                result = new CsFile(path);
                CsFilePool.Add(path, result);
            }
            return(result);
        }
Example #2
0
        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);
        }
Example #3
0
 public static IEnumerable <CsFile> GetCsFiles(string dir)
 {
     return(Directory.EnumerateFiles(dir, "*.cs", SearchOption.AllDirectories)
            .Select(file => CsFile.Get(file)));
 }