private void TriggerEvent(string fileName, VerifyResult result, CompletedHandle callback = null) { if (callback != null) { try { callback(this, result); } catch (Exception exp) { Logger.AddLog(this.GetType(), "TriggerEvent", exp.Message); } } else if (OnCompleted != null) { try { OnCompleted(this, result); } catch (Exception exp) { Logger.AddLog(this.GetType(), "TriggerEvent", exp.Message); } } }
public void VerifyPersonAsync(string url, string fileName, Image alarmImg, Dictionary <string, string> formItems = null, CompletedHandle callback = null) { ThreadPool.QueueUserWorkItem(delegate { VerifyResult result = VerifyImage(url, fileName, alarmImg, formItems); TriggerEvent(fileName, result, callback); }); }