Example #1
0
        private void ProcessLinks(ProjectDetailRepository projectRepository, ISet <InvestigationLink> linksToBeInvestigated, bool includeExternalReferences)
        {
            while (linksToBeInvestigated.Any())
            {
                var investigation = linksToBeInvestigated.First();
                _ = linksToBeInvestigated.Remove(investigation);

                if (!investigation.IsProjectLoadable)
                {
                    continue;
                }

                if (!projectRepository.Has(investigation.Guid))
                {
                    var projectDetail = _projectFactory.MakeProjectDetail(projectRepository, investigation.FullPath, investigation.Guid, includeExternalReferences);
                    if (investigation.Parent != null)
                    {
                        _ = projectDetail.ParentProjects.Add(new ProjectLinkObject(projectRepository.GetById(investigation.Parent.Id)));
                    }

                    var parent = new ProjectLinkObject(projectDetail);

                    var children = projectDetail.ChildProjects.Select(child => new InvestigationLink(parent, child));

                    linksToBeInvestigated.UnionWith(children);

                    projectRepository.Add(projectDetail);
                }
            }
        }
        /// <summary>
        /// Creates a project detail object from the path to a CS project file.
        /// </summary>
        /// <param name="fullFilePath"></param>
        /// <returns></returns>
        public ProjectDetail MakeProjectDetail(ProjectDetailRepository projectRepository, string fullFilePath, Guid guid, bool includeExternalReferences)
        {
            if (!_cachedProjects.ContainsKey(fullFilePath))
            {
                _cachedProjects.Add(fullFilePath, new ProjectFile(fullFilePath));
            }

            var projectFile = _cachedProjects[fullFilePath];

            return(new ProjectDetail(projectRepository, fullFilePath, guid, projectFile, includeExternalReferences));
        }
 public RootNodeToYumlClassDiagramTranslator(ProjectDetailRepository projectRepository)
 {
     ProjectRepository = projectRepository;
 }
Example #4
0
 private void ProcessCsProjRootNode(ProjectDetailRepository projectRepository, string fullPath, bool includeExternalReferences)
 {
     ProcessLinks(projectRepository, new HashSet <InvestigationLink> {
         new InvestigationLink(null, ProjectLinkObject.MakeOutOfSolutionLink(fullPath))
     }, includeExternalReferences);
 }