From 52333beabe767dd917edae79e7097a5373f356d5 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Sat, 11 Feb 2017 08:10:26 -0700 Subject: [PATCH] added support for setting the password-mask char for the new-password control --- .../Controls/NewPasswordWithVerification.cs | 32 +++++++++++++++++++ ...CredentialRepositoryEditorPage.Designer.cs | 2 ++ 2 files changed, 34 insertions(+) diff --git a/mRemoteV1/UI/Controls/NewPasswordWithVerification.cs b/mRemoteV1/UI/Controls/NewPasswordWithVerification.cs index c7b5f1270..111a74951 100644 --- a/mRemoteV1/UI/Controls/NewPasswordWithVerification.cs +++ b/mRemoteV1/UI/Controls/NewPasswordWithVerification.cs @@ -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(); diff --git a/mRemoteV1/UI/Forms/CredentialManagerPages/CredentialRepositoryEditorPages/XmlCredentialRepositoryEditorPage.Designer.cs b/mRemoteV1/UI/Forms/CredentialManagerPages/CredentialRepositoryEditorPages/XmlCredentialRepositoryEditorPage.Designer.cs index 4d7338018..9f44f8390 100644 --- a/mRemoteV1/UI/Forms/CredentialManagerPages/CredentialRepositoryEditorPages/XmlCredentialRepositoryEditorPage.Designer.cs +++ b/mRemoteV1/UI/Forms/CredentialManagerPages/CredentialRepositoryEditorPages/XmlCredentialRepositoryEditorPage.Designer.cs @@ -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 //