Example #1
0
        private async void LoginControl_OnAuthenticate(object sender, EventArgs e)
        {
            WebhostAPICall.AuthenticationInfo response = (WebhostAPICall.AuthenticationInfo)sender;
            if (response.Fingerprint.Length > 0)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog("Authentication Successful.");
                await messageDialog.ShowAsync();

                passwordBox.Password = "";

                // Continue on to the rest of the program from here.
                // this line is a simplified check to make sure the event handler is not null and then invoke if it has a handler.
                OnAuthenticationCompleted?.Invoke(response, e);
            }
            else
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog("Authentication returned a blank fingerprint.");
                await messageDialog.ShowAsync();

                passwordBox.Password = "";
            }
        }
Example #2
0
 /// <summary>
 /// Notifies the on completed event.
 /// </summary>
 /// <param name="authenticatedUserResponse">The <see cref="AuthenticatedUserResponseEventArgs"/> instance containing the event data.</param>
 protected void NotifyOnCompletedEvent(AuthenticatedUserResponseEventArgs authenticatedUserResponse)
 {
     _authenticator.Completed -= OnAuthenticationCompletedCallback;
     OnAuthenticationCompleted?.Invoke(this, authenticatedUserResponse);
 }