/// <summary> /// Gets all modules referenced by this module. /// </summary> /// <returns>All referenced modules.</returns> public IEnumerable <IPsiModuleReference> GetReferences(IModuleReferenceResolveContext moduleReferenceResolveContext) { _shellLocks.AssertReadAccessAllowed(); var references = new PsiModuleReferenceAccumulator(TargetFrameworkId); foreach (IAssemblyCookie cookie in _assemblyReferences.Values) { if (cookie.Assembly == null) { continue; } IPsiModule psiModule = _psiModules.GetPrimaryPsiModule(cookie.Assembly, TargetFrameworkId); // Normal assembly. if (psiModule != null) { references.Add(new PsiModuleReference(psiModule)); } // Assembly that is the output of a current project: reference the project instead. else { IProject project = _outputAssemblies.GetProjectByOutputAssembly(cookie.Assembly); if (project != null) { psiModule = _psiModules.GetPrimaryPsiModule(project, TargetFrameworkId); if (psiModule != null) { references.Add(new PsiModuleReference(psiModule)); } } } } return(references.GetReferences()); }
/// <summary> /// Gets all modules referenced by this module. /// </summary> /// <returns>All referenced modules.</returns> public IEnumerable <IPsiModuleReference> GetReferences() { _shellLocks.AssertReadAccessAllowed(); var references = new PsiModuleReferenceAccumulator(); foreach (IAssemblyCookie cookie in _assemblyReferences.Values) { if (cookie.Assembly == null) { continue; } IPsiModule psiModule = _psiModuleManager.GetPrimaryPsiModule(cookie.Assembly); // Normal assembly. if (psiModule != null) { references.Add(new PsiModuleReference(psiModule)); } // Assembly that is the output of a current project: reference the project instead. else { foreach (IProject project in _outputAssembliesCache.GetProjectsByAssembly(cookie.Assembly)) { psiModule = _psiModuleManager.GetPrimaryPsiModule(project); if (psiModule != null) { references.Add(new PsiModuleReference(psiModule)); } } } } return(references.GetReferences()); }
/// <summary> /// Gets all modules referenced by this module. /// </summary> /// <returns>All referenced modules.</returns> public IEnumerable<IPsiModuleReference> GetReferences(IModuleReferenceResolveContext moduleReferenceResolveContext) { _shellLocks.AssertReadAccessAllowed(); var references = new PsiModuleReferenceAccumulator(TargetFrameworkId); foreach (IAssemblyCookie cookie in _assemblyReferences.Values) { if (cookie.Assembly == null) continue; IPsiModule psiModule = _psiModules.GetPrimaryPsiModule(cookie.Assembly, TargetFrameworkId); // Normal assembly. if (psiModule != null) references.Add(new PsiModuleReference(psiModule)); // Assembly that is the output of a current project: reference the project instead. else { IProject project = _outputAssemblies.GetProjectByOutputAssembly(cookie.Assembly); if (project != null) { psiModule = _psiModules.GetPrimaryPsiModule(project, TargetFrameworkId); if (psiModule != null) references.Add(new PsiModuleReference(psiModule)); } } } return references.GetReferences(); }
/// <summary> /// Gets all modules referenced by this module. /// </summary> /// <returns>All referenced modules.</returns> public IEnumerable<IPsiModuleReference> GetReferences() { _shellLocks.AssertReadAccessAllowed(); var references = new PsiModuleReferenceAccumulator(); foreach (IAssemblyCookie cookie in _assemblyReferences.Values) { if (cookie.Assembly == null) continue; IPsiModule psiModule = _psiModuleManager.GetPrimaryPsiModule(cookie.Assembly); // Normal assembly. if (psiModule != null) references.Add(new PsiModuleReference(psiModule)); // Assembly that is the output of a current project: reference the project instead. else { foreach (IProject project in _outputAssembliesCache.GetProjectsByAssembly(cookie.Assembly)) { psiModule = _psiModuleManager.GetPrimaryPsiModule(project); if (psiModule != null) references.Add(new PsiModuleReference(psiModule)); } } } return references.GetReferences(); }