private void LoadProjectFile(string title, string pathToProjectFile) { _buildMessenger.ExecuteOnStepMessage(_strings.ReadingProject + ": " + title); var project = new CSharpProject(this, title, pathToProjectFile); Projects.Add(project); }
public CSharpFile(CSharpProject project, string fileName) { Project = project; FileName = fileName; OriginalText = File.ReadAllText(fileName, Encoding.Default); var p = new CSharpParser(project.CompilerSettings); SyntaxTree = p.Parse(OriginalText, fileName); UnresolvedTypeSystemForFile = SyntaxTree.ToTypeSystem(); LinesOfCode = 1 + OriginalText.Count(c => c == '\n'); }
internal void ParseProjectNamespaces(CSharpProject project) { var types = project.Compilation.MainAssembly.TopLevelTypeDefinitions.ToList(); for (int i = 0; i < types.Count; i++) { HandleOnItemParseStart(types[i].Namespace, i, types.Count); if (!_excludedIdentifiers.Contains(types[i].Namespace)) { _repository.AddNamespace(GetParsedNamespace(types[i])); } } }
internal void ParseProjectTypes(CSharpProject project) { var types = project.Compilation.MainAssembly.TopLevelTypeDefinitions.ToList(); for (int i = 0; i < types.Count; i++ ) { if (types[i].Kind != TypeKind.Delegate) { HandleOnItemParseStart(string.Format("{0}.{1}", types[i].Namespace, types[i].Name), i, types.Count); if (!_excludedIdentifiers.Contains(types[i].GetIdentifier())) { var sdType = GetParsedType(types[i].GetDefinition(), false); _repository.AddNamespaceTypeRelation(types[i].Namespace, sdType.Identifier); } } } }