private static XmlSchemaType FindSchemaType(string name, XmlSchemaObjectCollection items)
{
// Have to loop through the items because schema.SchemaTypes has not been populated yet.
foreach (object o in items)
{
XmlSchemaType type = o as XmlSchemaType;
if (type == null)
continue;
if (type.Name == name)
return type;
}
return null;
}