private static void PopulateCodeElementsFromTypeDeclaration(List <ICodeElementInfo> codeElements, PsiReflectionPolicy reflectionPolicy, ITypeDeclaration declaration)
            {
                if (!declaration.IsValid())
                {
                    return;
                }

                ITypeInfo typeInfo = reflectionPolicy.Wrap(declaration.DeclaredElement);

                if (typeInfo != null)
                {
                    codeElements.Add(typeInfo);
                }

                foreach (ITypeDeclaration nestedDeclaration in declaration.NestedTypeDeclarations)
                {
                    PopulateCodeElementsFromTypeDeclaration(codeElements, reflectionPolicy, nestedDeclaration);
                }
            }
            private static void PopulateCodeElementsFromTypeDeclaration(List<ICodeElementInfo> codeElements, PsiReflectionPolicy reflectionPolicy, ITypeDeclaration declaration)
            {
                if (! declaration.IsValid())
                    return;

                ITypeInfo typeInfo = reflectionPolicy.Wrap(declaration.DeclaredElement);

                if (typeInfo != null)
                    codeElements.Add(typeInfo);

                foreach (ITypeDeclaration nestedDeclaration in declaration.NestedTypeDeclarations)
                    PopulateCodeElementsFromTypeDeclaration(codeElements, reflectionPolicy, nestedDeclaration);
            }