private int GetXmlSchemaElementCount(XmlSchemaElement xmlSchemaElement)
{
// Get the complex type of the Customer element.
XmlSchemaComplexType complexType = xmlSchemaElement.ElementSchemaType as XmlSchemaComplexType;
if (complexType != null)
{
return (complexType.ContentTypeParticle as XmlSchemaSequence).Items.OfType<XmlSchemaElement>().Count();
}
return 0;
}