Ejemplo n.º 1
0
        private void OnCapturingCompleted(IAsyncResult ar)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new AsyncCallback(OnCapturingCompleted), ar);
            }
            else
            {
                try
                {
                    var status = _biometricClient.EndCapture(ar);

                    if (status != NBiometricStatus.Ok)
                    {
                        CaptureFailedFormSettings();
                        _subject.Faces[0].Image = null;
                        _currentop = Ops.Capturingfailed;
                    }
                    else
                    {
                        _currentop = Ops.Ongoing;

                        _biometricClient.BeginVerify(_subjectFromFile, _subject, OnVerifyCompleted, null);
                    }
                }
                catch (Exception)
                {
                    _biometricClient.Cancel();
                    CheckCamera();
                    CheckLicense();
                    Close();
                }
            }
        }