Example #1
0
 private void AddProjectsNodes(DGMLWriter dgml, List <Project> projects)
 {
     foreach (Project project in projects)
     {
         dgml.AddNode(project.Name, null, null, "Project");
     }
 }
Example #2
0
        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");
                    }
                }
            }
        }
Example #3
0
 private static void AddStyleToGraph(DGMLWriter dgml)
 {
     dgml.AddStyle("Project", "Blue");
     dgml.AddStyle("Package", "Purple");
     dgml.AddStyle("PackageGroup", "Plum");
     dgml.AddStyle("Library", "Green");
     dgml.AddStyle("GAC Library", "LightGreen");
 }
Example #4
0
        private void AddPackagesNodes(DGMLWriter dgml, List <Package> packages)
        {
            foreach (Package package in packages)
            {
                dgml.AddNode(package.Id, null, null, "Package");
            }

            AddGroupsForDiferentsVersionOfPackages(dgml, packages);
        }
Example #5
0
        public void generateDGML(string filename, List <Solution> solutions, List <Project> projects, List <Package> packages, List <Library> libraries)
        {
            DGMLWriter dgml = new DGMLWriter();

            AddProjectsNodes(dgml, projects);
            AddPackagesNodes(dgml, packages);
            AddLibrariesNodes(dgml, libraries);
            AddLinksBetweenNodes(dgml, solutions);
            AddStyleToGraph(dgml);

            dgml.Serialize(filename);
        }
Example #6
0
        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"));
            }
        }
Example #7
0
        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");
                }
            }
        }