コード例 #1
0
        /// <summary>
        /// when the button is clicked, either confirms the email and disappears or informs the user of a mistake
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ButtonConfirmEmail_Clicked(object sender, EventArgs e)
        {
            OperationReturnMessage result = await Task.Run(() => ServerOperations.ConfirmEmail(this.username, this.EntryConfirmationCode.Text.Trim()));

            if (result == OperationReturnMessage.True)
            {
                this.emailConfirmed = true;
                await this.Navigation.PopModalAsync(true);
            }
            else
            {
                this.LabelMessage.Text = "Email could not be confirmed. Please try your code again.";
            }
        }
コード例 #2
0
 /// <summary>
 /// Confirm the email associated with the account in a background task.
 /// </summary>
 /// <param name="token">The confirmation token sent to the user's email.</param>
 /// <returns></returns>
 private OperationReturnMessage ConfirmEmail(string token)
 {
     Device.BeginInvokeOnMainThread(() => this.LabelConfirmEmailMessage.Text = "Waiting...");
     return(ServerOperations.ConfirmEmail(CredentialManager.Username, token.Trim()));
 }