private void CatalogPublicTypes(IEnumerable <Type> types) { string lastNs = "!!not a namespace!!"; ReflectionNamespace lastNsEntity = null; foreach (Type type in types) { #if DNXCORE50 if (!type.GetTypeInfo().IsPublic) { continue; } #else if (!type.IsPublic) { continue; } #endif string ns = type.Namespace ?? string.Empty; //retrieve the namespace only if we don't have it handy already //usually we'll have it since GetExportedTypes() seems to export //types in a sorted fashion. if (ns != lastNs) { lastNs = ns; lastNsEntity = GetNamespace(ns); lastNsEntity.Add(type); } else { lastNsEntity.Add(type); } } }