protected static void ProcessEntity(SchemaInfo sinfo, string name, object sender, ValidationEventHandler eventhandler, string baseUri, int lineNumber, int linePosition) {
SchemaEntity en = (SchemaEntity)sinfo.GeneralEntities[new XmlQualifiedName(name)];
XmlSchemaException e = null;
if (en == null) {
// validation error, see xml spec [68]
e = new XmlSchemaException(Res.Sch_UndeclaredEntity, name, baseUri, lineNumber, linePosition);
}
else if (en.NData.IsEmpty) {
e = new XmlSchemaException(Res.Sch_UnparsedEntityRef, name, baseUri, lineNumber, linePosition);
}
if (e != null) {
if (eventhandler != null) {
eventhandler(sender, new ValidationEventArgs(e));
}
else {
throw e;
}
}
}