예제 #1
0
파일: UnlockForm.cs 프로젝트: wwj229/NLock
        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();
                }
            }
        }