private void OnTemplateCaptured(TemplateCapturedEventArgs e) { EventHandler<TemplateCapturedEventArgs> obj = TemplateCaptured; if (obj != null) { obj(this, e); } }
private void bsp_TemplateCaptured(object sender, TemplateCapturedEventArgs e) { lock (_locker) { if (!_finished) { switch (e.Status) { case TemplateCapturedStatus.ExtractorException: OnImageCaptured(new ImageCapturedEventArgs(ImageCapturedStatus.ExtractorException)); break; case TemplateCapturedStatus.MinutiaCountFailed: OnImageCaptured(new ImageCapturedEventArgs(ImageCapturedStatus.MinutiaCountFailed)); break; case TemplateCapturedStatus.QualityCheckFailed: OnImageCaptured(new ImageCapturedEventArgs(ImageCapturedStatus.QualityCheckFailed)); break; case TemplateCapturedStatus.Success: if (e.Template.MinutiaCount < Settings.Default.MinimumMinutiaCount) { OnImageCaptured(new ImageCapturedEventArgs(ImageCapturedStatus.MinutiaCountFailed)); } else { OnImageCaptured(new ImageCapturedEventArgs(ImageCapturedStatus.Success)); _capturedSamples.Add(e.Template); if (_capturedSamples.Count == _numSamples) { _finished = true; _captureReset.Set(); } } break; } } } }