private XmlSchemaComplexType GetComplexType(XmlSchemaObject schemaObject)
{
if (schemaObject == null)
{
return null;
}
XmlSchemaElement schemaElement = schemaObject as XmlSchemaElement;
XmlSchemaComplexType complexType = null;
if (schemaElement != null)
{
complexType = schemaElement.ElementSchemaType as XmlSchemaComplexType;
}
else
{
complexType = schemaObject as XmlSchemaComplexType;
}
return complexType;
}