Beispiel #1
0
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }

#if RESHARPER_61
            IPsiModule psiModule = _psiModuleManager.GetPrimaryPsiModule(project);
            if (psiModule == null)
            {
                return(null);
            }

            IDeclarationsCache declarationsCache = _cacheManager.GetDeclarationsCache(psiModule, true, true);
#else
            IPsiModule psiModule = _provider.PsiModuleManager.GetPrimaryPsiModule(project);
            if (psiModule == null)
            {
                return(null);
            }

            IDeclarationsCache declarationsCache = _provider.CacheManager.GetDeclarationsCache(psiModule, true, true);
#endif
            return(declarationsCache.GetTypeElementByCLRName(_declaringTypeName));
        }
        public override IDeclaredElement GetDeclaredElement()
        {
            PsiManager         manager           = PsiManager.GetInstance(GetSolution());
            IDeclarationsCache declarationsCache = manager.GetDeclarationsCache(DeclarationsScopeFactory.ModuleScope(PsiModuleManager.GetInstance(GetSolution()).GetPrimaryPsiModule(GetProject()), false), true);

            return(declarationsCache.GetTypeElementByCLRName(GetTypeClrName()));
        }
Beispiel #3
0
        public override IDeclaredElement GetDeclaredElement()
        {
            var solution                         = GetSolution();
            var module                           = PsiModuleManager.GetInstance(solution).GetPsiModule(GetProject().ProjectFile);
            IDeclarationsScope scope             = DeclarationsScopeFactory.ModuleScope(module, false);
            IDeclarationsCache declarationsCache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);

            return(declarationsCache.GetTypeElementByCLRName(GetTypeClrName()));
        }
Beispiel #4
0
        protected ITypeElement GetDeclaredType()
        {
            ISolution solution = GetSolution();

            if (solution == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                IDeclarationsScope scope = DeclarationsScopeFactory.SolutionScope(solution, false);
                IDeclarationsCache cache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);
                return(cache.GetTypeElementByCLRName(_declaringTypeName));
            }
        }
Beispiel #5
0
        public override IDeclaredElement GetDeclaredElement()
        {
            ISolution solution = GetSolution();

            if (solution == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                DeclarationsCacheScope scope = DeclarationsCacheScope.SolutionScope(solution, false);
                IDeclarationsCache     cache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);
                return(cache.GetTypeElementByCLRName(GetTypeClrName()));
            }
        }
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }
            PsiManager manager = PsiManager.GetInstance(project.GetSolution());

            using (ReadLockCookie.Create())
            {
                IDeclarationsCache declarationsCache = manager.GetDeclarationsCache(DeclarationsScopeFactory.ModuleScope(PsiModuleManager.GetInstance(project.GetSolution()).GetPrimaryPsiModule(project), true), true);
                return(declarationsCache.GetTypeElementByCLRName(myTypeName));
            }
        }
Beispiel #7
0
        protected ITypeElement GetDeclaredType()
        {
            IProject project = GetProject();

            if (project == null)
            {
                return(null);
            }

            using (ReadLockCookie.Create())
            {
                var solution                         = GetSolution();
                var module                           = PsiModuleManager.GetInstance(solution).GetPsiModule(GetProject().ProjectFile);
                IDeclarationsScope scope             = DeclarationsScopeFactory.ModuleScope(module, true);
                IDeclarationsCache declarationsCache = PsiManager.GetInstance(solution).GetDeclarationsCache(scope, true);

                return(declarationsCache.GetTypeElementByCLRName(myTypeName));
            }
        }