private static IEnumerable <string> AllNamespaces(this ITypeDefinition type) { INestedTypeDefinition nestedType = type as INestedTypeDefinition; if (nestedType != null) { return(nestedType.AllNamespaces()); } INamespaceTypeReference namespaceType = type as INamespaceTypeReference; if (namespaceType != null) { return(namespaceType.AllNamespaces()); } return("".Return()); }