private static IEnumerable <ITypeElement> FindTypeElements(INamespace ns, ISymbolScope symbolScope) { foreach (var te in ns.GetNestedTypeElements(symbolScope)) { yield return(te); foreach (var nte in te.NestedTypes) { yield return(nte); } } foreach (var nsNested in ns.GetNestedNamespaces(symbolScope)) { foreach (var te in FindTypeElements(nsNested, symbolScope)) { yield return(te); } } }