private void CatalogPublicTypes(Type[] types)
{
string lastNs = "!!not a namespace!!";
NamespaceEntity lastNsEntity = null;
foreach (Type type in types)
{
if (!type.IsPublic) continue;
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);
}
}
}