private bool IsValidAttributeGroupRedefine(XmlSchemaObject existingObject, XmlSchemaObject item) {
XmlSchemaAttributeGroup attGroup = item as XmlSchemaAttributeGroup;
if (existingObject == attGroup.Redefined) { //attribute group is the redefinition of existingObject
XmlSchemaAttributeGroup existingAttGroup = existingObject as XmlSchemaAttributeGroup;
if (existingAttGroup.AttributeUses.Count == 0) { //If the existing one is not already compiled, then replace.
return true;
}
}
return false;
}