예제 #1
0
        private async void TakePictureForRegistration(string fileName)
        {
            var response = await registerViewModel.AddFaceToPerson(fileName);

            if (response == Response.OK)
            {
                progressBar.Value = ProgressBarValueFactor * registerViewModel.photosTaken;

                if (registerViewModel.photosTaken == RequiredNumberOfPhotos)
                {
                    MessageBox.Show(RegistrationSuccessful);
                    new SignInForm().Show();
                    Close();
                }
            }
            else if (response == Response.ApiTrainingError)
            {
                MessageBox.Show(ApiErrorMessage);
                new SignInForm().Show();
                Close();
            }
            else
            {
                MessageBox.Show(WarningFaceDetection);
            }
        }