private void checkControls()
 {
     Debug.WriteLine("checkControls");
     if (this.pwChangerWorker != null && this.pwChangerWorker.IsRunning)
     {
         return;
     }
     if (this.maskedTextBoxNewPassword.UseSystemPasswordChar && this.passwordsMatch() ||
         !this.maskedTextBoxNewPassword.UseSystemPasswordChar && FormsUtils.HasText(this.maskedTextBoxNewPassword))
     {
         this.buttonChangePassword.Enabled = true;
     }
     else
     {
         this.buttonChangePassword.Enabled = false;
     }
     this.maskedTextBoxRepeatNewPassword.Enabled = this.maskedTextBoxNewPassword.UseSystemPasswordChar;
 }
Пример #2
0
 private void checkControls()
 {
     Debug.WriteLine("checkControls");
     if (this.pwChangerWorker != null && this.pwChangerWorker.IsRunning)
     {
         return;
     }
     if (this.getSelectedEntries().Count > 0 &&
         (this.maskedTextBoxNewPassword.UseSystemPasswordChar && this.passwordsMatch() ||
          !this.maskedTextBoxNewPassword.UseSystemPasswordChar && FormsUtils.HasText(this.maskedTextBoxNewPassword)) &&
         this.isHostTypeConfigured())
     {
         this.buttonStartChangePasswords.Enabled = true;
     }
     else
     {
         this.buttonStartChangePasswords.Enabled = false;
     }
     this.maskedTextBoxRepeatNewPassword.Enabled = this.maskedTextBoxNewPassword.UseSystemPasswordChar;
 }
 private void checkPasswords(object sender, EventArgs e)
 {
     Debug.WriteLine("checkPasswords");
     if (this.maskedTextBoxNewPassword.UseSystemPasswordChar)
     {
         if (FormsUtils.HasText(this.maskedTextBoxNewPassword) && this.passwordsMatch())
         {
             this.maskedTextBoxRepeatNewPassword.BackColor = Color.Empty;
         }
         else if (!FormsUtils.HasText(this.maskedTextBoxNewPassword) && !FormsUtils.HasText(this.maskedTextBoxRepeatNewPassword))
         {
             this.maskedTextBoxRepeatNewPassword.BackColor = Color.Empty;
         }
         else
         {
             this.maskedTextBoxRepeatNewPassword.BackColor = ColorTranslator.FromHtml("#FFC0C0");
         }
     }
     else
     {
         this.maskedTextBoxNewPassword.ResetBackColor();
         this.maskedTextBoxRepeatNewPassword.ResetBackColor();
     }
 }
 private bool passwordsMatch()
 {
     Debug.WriteLine("passwordsMatch");
     return(FormsUtils.HasText(this.maskedTextBoxNewPassword) &&
            this.maskedTextBoxNewPassword.Text.Equals(this.maskedTextBoxRepeatNewPassword.Text));
 }