private async void EnrollUserCredential_Button(object sender, RoutedEventArgs e)
        {
            using (Logger.TraceMehtod())
            {
                try
                {
                    if (userTicket == null)
                    {
                        MessageBox.Show("Authenticate first!");
                        return;
                    }
                    var user = UserName.Parse(AutenticateUserName.Text);
                    var cred = EnrollCredentialsWindow.ShowDialog(Application.Current.MainWindow, user);

                    if (cred == null)
                    {
                        return;
                    }

                    await enrollmentService.EnrollCredential(officerTicket, userTicket, cred);

                    EnrollUserCredentialUserResult.Text = "Ok";
                }
                catch (Exception ex)
                {
                    EnrollUserCredentialUserResult.Text = ex.Message;
                }
            }
        }
示例#2
0
        public static IEnrollmentCredential ShowDialog(Window owner, UserName userName)
        {
            var win = new EnrollCredentialsWindow(userName);

            win.Owner = owner;

            using (win.fingerprintEngine = new FingerprintEngine())
                using (win.fingerprintImage)
                    using (win.cardEngine = new CardEngine())
                    {
                        if (win.ShowDialog() == true)
                        {
                            return(win.credential);
                        }
                        return(null);
                    }
        }