added support for setting the password-mask char for the new-password control

This commit is contained in:
David Sparer
2017-02-11 08:10:26 -07:00
parent 49d1e0622b
commit 52333beabe
2 changed files with 34 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Security;
using System.Windows.Forms;
@@ -8,9 +9,40 @@ namespace mRemoteNG.UI.Controls
{
public partial class NewPasswordWithVerification : UserControl
{
private bool _useSystemPasswordChar;
private char _passwordChar;
[Browsable(false)]
public SecureString SecureString { get; private set; }
[Browsable(false)]
public bool PasswordsMatch { get; private set; }
[Browsable(true)]
public char PasswordChar
{
get { return _passwordChar; }
set
{
_passwordChar = value;
secureTextBox1.PasswordChar = _passwordChar;
secureTextBox2.PasswordChar = _passwordChar;
}
}
[Browsable(true)]
public bool UseSystemPasswordChar
{
get { return _useSystemPasswordChar; }
set
{
_useSystemPasswordChar = value;
secureTextBox1.UseSystemPasswordChar = _useSystemPasswordChar;
secureTextBox2.UseSystemPasswordChar = _useSystemPasswordChar;
}
}
public NewPasswordWithVerification()
{
InitializeComponent();

View File

@@ -136,8 +136,10 @@
this.newPasswordBoxes.Location = new System.Drawing.Point(32, 154);
this.newPasswordBoxes.MinimumSize = new System.Drawing.Size(0, 100);
this.newPasswordBoxes.Name = "newPasswordBoxes";
this.newPasswordBoxes.PasswordChar = '\0';
this.newPasswordBoxes.Size = new System.Drawing.Size(319, 100);
this.newPasswordBoxes.TabIndex = 13;
this.newPasswordBoxes.UseSystemPasswordChar = true;
//
// XmlCredentialRepositoryEditorPage
//