private void AddLinksBetweenNodes(DGMLWriter dgml, List <Solution> solutions) { foreach (Solution solution in solutions) { dgml.AddNode(solution.Name, solution.Name, "Expanded", "Solution"); foreach (Project project in solution.Projects) { dgml.AddLink(solution.Name, project.Name, null, "Contains"); foreach (Project projectChild in project.Projects) { dgml.AddLink(project.Name, projectChild.Name, null, "Project Reference"); } foreach (Package package in project.Packages) { dgml.AddLink(project.Name, package.Id, null, "Installed Package"); } foreach (Library library in project.Libraries) { dgml.AddLink(project.Name, library.Name, null, "Library Reference"); } } } }
private void AddLibrariesNodes(DGMLWriter dgml, List <Library> libraries) { dgml.AddNode("GlobalAssemblyCache", "Global Assembly Cache", "Collapsed", "GAC Library"); dgml.AddNode("LocalLibraries", "Local Libraries", "Expanded", "Libraries"); foreach (Library library in libraries) { if (library.IsGAC) { dgml.AddNode(library.Name, null, null, "GAC Library"); dgml.AddLink("GlobalAssemblyCache", library.Name, null, "Contains"); } else { dgml.AddNode(library.Name, null, null, "Library"); dgml.AddLink("LocalLibraries", library.Name, null, "Contains"); } } }
private void AddGroupsForDiferentsVersionOfPackages(DGMLWriter dgml, List <Package> packages) { var groupedPackages = packages .GroupBy(u => u.Name) .Select(grp => grp.ToList()) .ToList(); foreach (List <Package> packageGrouped in groupedPackages) { dgml.AddNode(packageGrouped[0].Name, packageGrouped[0].Name, "Expanded", "PackageGroup"); foreach (Package package in packageGrouped) { dgml.AddLink(package.Name, package.Id, null, "Contains"); } //dgml.AddLink(new DGMLWriter.Link(project.Name, package.Name + " " + package.Version, null, "Installed Package")); } }