コード例 #1
0
        public static IEnumerable <ITypeElement> GetTypeElementsByClrName(ISolution solution, string clrName)
        {
            IPsiServices psiServices = solution.GetComponent <IPsiServices>();

            psiServices.Files.CommitAllDocuments();

            ISymbolCache symbolCache = psiServices.Symbols;
            ISymbolScope symbolScope = symbolCache.GetSymbolScope(LibrarySymbolScope.FULL, true);

            IEnumerable <ITypeElement> validTypeElements = symbolScope.GetTypeElementsByCLRName(clrName)
                                                           .Where(element => element.IsValid());

            return(SkipDefaultProfileIfRuntimeExist(validTypeElements));
        }