private void CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) {
if (particle is XmlSchemaElement) {
XmlSchemaElement localElement = (XmlSchemaElement)particle;
CompileElement(localElement);
if (complexType.LocalElements[localElement.QualifiedName] == null) {
complexType.LocalElements.Add(localElement.QualifiedName, localElement);
}
else {
XmlSchemaElement element = (XmlSchemaElement)complexType.LocalElements[localElement.QualifiedName];
if (element.ElementSchemaType != localElement.ElementSchemaType) {
SendValidationEvent(Res.Sch_ElementTypeCollision, particle);
}
}
}
else if (particle is XmlSchemaGroupBase) {
XmlSchemaObjectCollection particles = ((XmlSchemaGroupBase)particle).Items;
foreach (XmlSchemaParticle p in particles) {
CompileParticleElements(complexType, p);
}
}
}