mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
added support for setting the password-mask char for the new-password control
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user