Example #1
0
        /// <summary>
        /// Verify and create the authenticator if needed
        /// </summary>
        /// <returns>true is successful</returns>
        private bool verifyAuthenticator(string privatekey)
        {
            this.Authenticator.Name = nameField.Text;

            try
            {
                GuildWarsAuthenticator authenticator = new GuildWarsAuthenticator();
                authenticator.Enroll(privatekey);
                this.Authenticator.AuthenticatorData = authenticator;
                this.Authenticator.Name = this.nameField.Text;

                codeField.Text = authenticator.CurrentCode;
                newAuthenticatorProgress.Visible = true;
                newAuthenticatorTimer.Enabled    = true;
            }
            catch (Exception ex)
            {
                WinAuthForm.ErrorDialog(this.Owner, "Unable to create the authenticator: " + ex.Message, ex);
                return(false);
            }

            return(true);
        }
		/// <summary>
		/// Verify and create the authenticator if needed
		/// </summary>
		/// <returns>true is successful</returns>
		private bool verifyAuthenticator(string privatekey)
		{
			this.Authenticator.Name = nameField.Text;

			try
			{
				GuildWarsAuthenticator authenticator = new GuildWarsAuthenticator();
				authenticator.Enroll(privatekey);
				this.Authenticator.AuthenticatorData = authenticator;
				this.Authenticator.Name = this.nameField.Text;

				codeField.Text = authenticator.CurrentCode;
				newAuthenticatorProgress.Visible = true;
				newAuthenticatorTimer.Enabled = true;
			}
			catch (Exception ex)
			{
				WinAuthForm.ErrorDialog(this.Owner, "Unable to create the authenticator: " + ex.Message, ex);
				return false;
			}

			return true;
		}