I am using DevForce version 6.0.7.
The current instance is null when verifierContext.EndOfBatch is true. In fact, I have logic to execute only when EndOfBatch is true (which I did not notice earlier), and the current instance is not available at that point.
I duplicated this issue in the sample application provided by DevForce earlier. Please let me know if you need additional information.
Thanks
Sample Code:
--------------
....
_mgr.VerifierEngine.BatchInterceptor = TestBatchInterceptor;
...
-----------
...
public static VerifierErrorContinuationMode TestBatchInterceptor(object currInstance, TriggerContext triggerContext, VerifierContext verifierContext)
{
if (verifierContext.EndOfBatch)
{
verifierContext.VerifierResults.Add(new VerifierResult(VerifierResultCode.Error,
String.Format(
"Accumulated a total of {0} error(s)",
verifierContext.VerifierResults.Errors.Count)));
return VerifierErrorContinuationMode.Stop;
}
else
{
return VerifierErrorContinuationMode.Continue;
}
}