/// <summary> /// Verifies the password in the text box is valid, prompts the user, then closes the window if successful. /// </summary> private void changePassword() { // If you want requirements for passwords, (such as 8 characters in length, etc.) implement it here. if ((codeBox.Text.Trim() == "") || (codeBox2.Text.Trim() == "")) { MPAiMessageBoxFactory.Show("Passwords should not be empty!", "Oops", MPAiMessageBoxButtons.OK); } else if (codeBox.Text != codeBox2.Text) { MPAiMessageBoxFactory.Show("Passwords do not match!", "Oops", MPAiMessageBoxButtons.OK); } else if (codeBox.Text.Equals(currentUser.getCode())) { MPAiMessageBoxFactory.Show("That is already your password!", "Oops", MPAiMessageBoxButtons.OK); } else { UserManagement.ChangeCurrentUserCode(codeBox.Text); UserManagement.WriteSettings(); MPAiMessageBoxFactory.Show("Password changed! ", "Done", MPAiMessageBoxButtons.OK); Close(); } }