Пример #1
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()));
        }
Пример #2
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));
            }
        }
Пример #3
0
        public override IDeclaredElement GetDeclaredElement()
        {
            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(GetTypeClrName()));
            }
        }
Пример #4
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));
            }
        }