/// <summary> /// Recursively search if this project reference guid is in cycle. /// </summary> private bool IsReferenceInCycle(Guid projectGuid) { // TODO: This has got to be wrong, it doesn't work w/ other project types. IVsHierarchy hierarchy = VsShellUtilities.GetHierarchy(this.ProjectMgr.Site, projectGuid); IReferenceContainerProvider provider = hierarchy.GetProject().GetCommonProject() as IReferenceContainerProvider; if (provider != null) { IReferenceContainer referenceContainer = provider.GetReferenceContainer(); Utilities.CheckNotNull(referenceContainer, "Could not found the References virtual node"); foreach (ReferenceNode refNode in referenceContainer.EnumReferences()) { ProjectReferenceNode projRefNode = refNode as ProjectReferenceNode; if (projRefNode != null) { if (projRefNode.ReferencedProjectGuid == this.ProjectMgr.ProjectIDGuid) { return(true); } if (this.IsReferenceInCycle(projRefNode.ReferencedProjectGuid)) { return(true); } } } } return(false); }
internal ProjectReferencesProperties(ProjectReferenceNode node) : base(node) { }