/// <summary> /// Returns true if the project identified by <paramref name="fromProject"/> has a reference (even indirectly) /// on the project identified by <paramref name="targetProject"/>. /// </summary> private bool ProjectAlreadyReferencesProject(LoadState loadedProjects, ProjectId fromProject, ProjectId targetProject) { ProjectInfo info; return(loadedProjects.TryGetValue(fromProject, out info) && info.ProjectReferences.Any(pr => pr.ProjectId == targetProject || ProjectAlreadyReferencesProject(loadedProjects, pr.ProjectId, targetProject))); }
/// <summary> /// Returns true if the project identified by <paramref name="fromProject"/> has a reference (even indirectly) /// on the project identified by <paramref name="targetProject"/>. /// </summary> private bool ProjectAlreadyReferencesProject(LoadState loadedProjects, ProjectId fromProject, ProjectId targetProject) { ProjectInfo info; return loadedProjects.TryGetValue(fromProject, out info) && info.ProjectReferences.Any(pr => pr.ProjectId == targetProject || ProjectAlreadyReferencesProject(loadedProjects, pr.ProjectId, targetProject)); }