private void AddType(Type type, XMLNamespace xns)
{
Util.Log("SdlGenerator.AddTypes "+type);
// System.Array says that it has element type, but returns null
// when asked for the element type.
if (type.HasElementType)
{
Type eType = type.GetElementType();
if (eType != null)
{
type = eType;
while (type.HasElementType)
type = type.GetElementType();
}
}
if (type.IsPrimitive == false)
{
String ns;
Assembly assem;
bool bInteropType = GetNSAndAssembly(type, out ns, out assem);
// Lookup the namespace
XMLNamespace dependsOnNS = LookupNamespace(ns, assem);
// Create a new namespace if neccessary
if (dependsOnNS == null)
dependsOnNS = AddNamespace(ns, assem, bInteropType);
// The supplied namespace depends directly on the namespace of the type
xns.DependsOnSchemaNS(dependsOnNS);
// Enqueue the type if it does not belong to system namespace
if ((ns == null) || !ns.StartsWith("System"))
{
_queue.Enqueue(type);
}
}
return;
}