System.Xml.Serialization.XmlSchemaExporter.IsAnyType C# (CSharp) Method

IsAnyType() private static method

private static IsAnyType ( XmlSchemaType schemaType, bool mixed, bool unbounded ) : bool
schemaType System.Xml.Schema.XmlSchemaType
mixed bool
unbounded bool
return bool
        private static bool IsAnyType(XmlSchemaType schemaType, bool mixed, bool unbounded)
        {
            XmlSchemaComplexType complexType = schemaType as XmlSchemaComplexType;
            if (complexType != null)
            {
                if (complexType.IsMixed != mixed)
                    return false;
                if (complexType.Particle is XmlSchemaSequence)
                {
                    XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.Particle;
                    if (sequence.Items.Count == 1 && sequence.Items[0] is XmlSchemaAny)
                    {
                        XmlSchemaAny any = (XmlSchemaAny)sequence.Items[0];
                        return (unbounded == any.IsMultipleOccurrence);
                    }
                }
            }
            return false;
        }