BExIS.Xml.Helpers.XsdSchemaReader.GetXmlSchemaElementCount C# (CSharp) Method

GetXmlSchemaElementCount() private method

private GetXmlSchemaElementCount ( XmlSchemaElement xmlSchemaElement ) : int
xmlSchemaElement System.Xml.Schema.XmlSchemaElement
return int
        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;
        }