private IEnumerable <IDependencyInfo> ExamineSource(ICodeFileInfo codeFile, ISolutionInfo solution, IList <ICodeFileInfo> parsedCodeFiles) { var result = GetCompilationResult(codeFile.GetContent()); var nodes = result.Flatten(); var dependencies = nodes.Select(node => new DependencyTypeFactory().For(node)) .Where(dependency => dependency != null) .Distinct(new DependencyComparer()).ToList(); parsedCodeFiles.Add(codeFile); foreach (var dependencyInfo in dependencies) { dependencyInfo.CodeFileInfo = solution.FindCodeFileFor(dependencyInfo); } var codeFileInfos = dependencies .Select(dependencyInfo => dependencyInfo.CodeFileInfo) .Where(codeFileInfo => codeFileInfo != null && !parsedCodeFiles.Contains(codeFileInfo)) .Distinct().ToList(); foreach (var code in codeFileInfos) { dependencies.AddRange(ExamineSource(code, solution, parsedCodeFiles)); } return(dependencies); }
private IEnumerable<IDependencyInfo> ExamineSource(ICodeFileInfo codeFile, ISolutionInfo solution, IList<ICodeFileInfo> parsedCodeFiles) { var result = GetCompilationResult(codeFile.GetContent()); var nodes = result.Flatten(); var dependencies = nodes.Select(node => new DependencyTypeFactory().For(node)) .Where(dependency => dependency != null) .Distinct(new DependencyComparer()).ToList(); parsedCodeFiles.Add(codeFile); foreach (var dependencyInfo in dependencies) { dependencyInfo.CodeFileInfo = solution.FindCodeFileFor(dependencyInfo); } var codeFileInfos = dependencies .Select(dependencyInfo => dependencyInfo.CodeFileInfo) .Where(codeFileInfo => codeFileInfo != null && !parsedCodeFiles.Contains(codeFileInfo)) .Distinct().ToList(); foreach (var code in codeFileInfos) { dependencies.AddRange(ExamineSource(code, solution, parsedCodeFiles)); } return dependencies; }
public IEnumerable<IDeclerationInfo> ExamineSource(ICodeFileInfo codeFile) { var result = GetCompilationResult(codeFile.GetContent()); var nodes = result.Flatten(); return nodes.Select(node => new DependencyTypeFactory().DeclerationFor(node, codeFile)) .Where(dependency => dependency != null) .Distinct(new DeclerationComparer()).ToList(); }
public IEnumerable <IDeclerationInfo> ExamineSource(ICodeFileInfo codeFile) { var result = GetCompilationResult(codeFile.GetContent()); var nodes = result.Flatten(); return(nodes.Select(node => new DependencyTypeFactory().DeclerationFor(node, codeFile)) .Where(dependency => dependency != null) .Distinct(new DeclerationComparer()).ToList()); }