private bool IsValidTypeRedefine(XmlSchemaObject existingObject, XmlSchemaObject item) {
XmlSchemaType schemaType = item as XmlSchemaType;
if (existingObject == schemaType.Redefined) { //schemaType is the redefinition of existingObject
XmlSchemaType existingType = existingObject as XmlSchemaType;
if (existingType.ElementDecl == null) { //If the existing one is not already compiled, then replace.
return true;
}
}
return false;
}