Exemplo n.º 1
0
        private void AddProjectDependecies(SolutionProject leaf, ProjectInSolution project)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(project.AbsolutePath);

            foreach (XmlElement projectReference in xmlDoc.GetElementsByTagName("ProjectReference"))
            {
                var dependency = Path.GetFileNameWithoutExtension(projectReference.GetAttribute("Include"));
                leaf.Dependencies.Add(dependency);
            }
        }
Exemplo n.º 2
0
        public void BuildTree(IEnumerable <ProjectInSolution> projectsInSolution, ISolutionProject parentComposite)
        {
            foreach (var projectChild in projectsInSolution)
            {
                if (projectChild.ProjectType == SolutionProjectType.SolutionFolder)
                {
                    var currentComposite = new SolutionFolder(projectChild.ProjectName);
                    parentComposite.Add(currentComposite);

                    BuildTree(GetProjectsInSolution(projectChild.ProjectGuid), currentComposite);
                }
                else
                {
                    var leaf = new SolutionProject(projectChild.ProjectName);
                    parentComposite.Add(leaf);
                    AddProjectDependecies(leaf, projectChild);
                }
            }
        }