private void CheckRefinedComplexType(XmlSchemaComplexType ctype) {
if (ctype.ContentModel != null) {
XmlQualifiedName baseName;
if (ctype.ContentModel is XmlSchemaComplexContent) {
XmlSchemaComplexContent content = (XmlSchemaComplexContent)ctype.ContentModel;
if (content.Content is XmlSchemaComplexContentRestriction) {
baseName = ((XmlSchemaComplexContentRestriction)content.Content).BaseTypeName;
}
else {
baseName = ((XmlSchemaComplexContentExtension)content.Content).BaseTypeName;
}
}
else {
XmlSchemaSimpleContent content = (XmlSchemaSimpleContent)ctype.ContentModel;
if (content.Content is XmlSchemaSimpleContentRestriction) {
baseName = ((XmlSchemaSimpleContentRestriction)content.Content).BaseTypeName;
}
else {
baseName = ((XmlSchemaSimpleContentExtension)content.Content).BaseTypeName;
}
}
if (baseName == ctype.QualifiedName) {
return;
}
}
SendValidationEvent(Res.Sch_InvalidTypeRedefine, ctype);
}