private async Task AddProjectReferencesToGraphAsync(VsProject parent, BidirectionalGraph <object, IEdge <object> > graph, List <NuGetPackageReference> packagesInGraph, List <VsProject> projectsInGraph)
        {
            foreach (var projectReference in parent.ProjectReferences)
            {
                var existingProject = TryGetExistingProject(projectReference, projectsInGraph);
                if (existingProject == null)
                {
                    var referencedProject = AllProjects.SingleOrDefault(p => p.IsSameProject(projectReference));
                    if (referencedProject != null)
                    {
                        AddProjectVertex(referencedProject, graph, projectsInGraph);
                        AddEdge(parent, referencedProject, Colors.Green, graph);

                        await AddNuGetPackagesToGraphAsync(referencedProject, referencedProject.NuGetReferences, Colors.DarkBlue, graph, packagesInGraph);
                        await AddProjectReferencesToGraphAsync(referencedProject, graph, packagesInGraph, projectsInGraph);
                    }
                }
                else
                {
                    AddEdge(parent, existingProject, Colors.Green, graph);
                }
            }
        }
Example #2
0
 public Project GetProject(string nameOrFullPath)
 {
     return(AllProjects.SingleOrDefault(x => nameOrFullPath.Equals(x.Name, StringComparison.Ordinal)) ??
            AllProjects.SingleOrDefault(x => x.Path.ToString().EqualsOrdinalIgnoreCase(nameOrFullPath)));
 }
Example #3
0
 public Project GetProject(string name)
 {
     return(AllProjects.SingleOrDefault(x => name.Equals(x.Name, StringComparison.Ordinal)));
 }
Example #4
0
 public IDotNetProjectInstance FindProjectById(string projectId)
 {
     return(AllProjects.SingleOrDefault(p => p.Id == projectId));
 }
Example #5
0
 public IDotNetProjectInstance GetProjectInstanceForProjectFile(string absolutePath)
 {
     return(AllProjects.SingleOrDefault(p => p.ProjectFileAbsolutePath == absolutePath));
 }
Example #6
0
        public IDotNetProjectInstance GetProjectInstanceForProjectFile(string absolutePath)
        {
            var target = absolutePath.ToLower();

            return(AllProjects.SingleOrDefault(p => p.ProjectFileAbsolutePath.ToLower() == target));
        }