472 lines
15 KiB
C#
472 lines
15 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: CarotDAV.MasterPasswordChangeForm
|
|
// Assembly: CarotDAV, Version=1.13.2.18337, Culture=neutral, PublicKeyToken=null
|
|
// MVID: C31F2651-A4A8-4D09-916A-8C6106F5E7C8
|
|
// Assembly location: F:\Eigene Dateien\Dropbox\portable Collection\Progs\CarotDAV\CarotDAV.exe
|
|
|
|
using Microsoft.VisualBasic.CompilerServices;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CarotDAV
|
|
{
|
|
[DesignerGenerated]
|
|
public class MasterPasswordChangeForm : Form
|
|
{
|
|
private IContainer components;
|
|
[AccessedThroughProperty("TextBoxPassword")]
|
|
private TextBox _TextBoxPassword;
|
|
[AccessedThroughProperty("m_CancelButton")]
|
|
private Button _m_CancelButton;
|
|
[AccessedThroughProperty("OKButton")]
|
|
private Button _OKButton;
|
|
[AccessedThroughProperty("Label1")]
|
|
private Label _Label1;
|
|
[AccessedThroughProperty("TextBoxNew")]
|
|
private TextBox _TextBoxNew;
|
|
[AccessedThroughProperty("TextBoxConfirm")]
|
|
private TextBox _TextBoxConfirm;
|
|
[AccessedThroughProperty("Label2")]
|
|
private Label _Label2;
|
|
[AccessedThroughProperty("Label3")]
|
|
private Label _Label3;
|
|
[AccessedThroughProperty("Label4")]
|
|
private Label _Label4;
|
|
[AccessedThroughProperty("Label5")]
|
|
private Label _Label5;
|
|
[AccessedThroughProperty("ButtonClear")]
|
|
private Button _ButtonClear;
|
|
public string MasterPassword;
|
|
|
|
public MasterPasswordChangeForm()
|
|
{
|
|
this.Load += new EventHandler(this.MasterPasswordChangeForm_Load);
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
try
|
|
{
|
|
if (!disposing || this.components == null)
|
|
return;
|
|
this.components.Dispose();
|
|
}
|
|
finally
|
|
{
|
|
base.Dispose(disposing);
|
|
}
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
private void InitializeComponent()
|
|
{
|
|
this.TextBoxPassword = new TextBox();
|
|
this.m_CancelButton = new Button();
|
|
this.OKButton = new Button();
|
|
this.Label1 = new Label();
|
|
this.TextBoxNew = new TextBox();
|
|
this.TextBoxConfirm = new TextBox();
|
|
this.Label2 = new Label();
|
|
this.Label3 = new Label();
|
|
this.Label4 = new Label();
|
|
this.Label5 = new Label();
|
|
this.ButtonClear = new Button();
|
|
this.SuspendLayout();
|
|
this.TextBoxPassword.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox textBoxPassword1 = this.TextBoxPassword;
|
|
Point point1 = new Point(64, 48);
|
|
Point point2 = point1;
|
|
textBoxPassword1.Location = point2;
|
|
this.TextBoxPassword.Name = "TextBoxPassword";
|
|
TextBox textBoxPassword2 = this.TextBoxPassword;
|
|
Size size1 = new Size(226, 19);
|
|
Size size2 = size1;
|
|
textBoxPassword2.Size = size2;
|
|
this.TextBoxPassword.TabIndex = 3;
|
|
this.TextBoxPassword.UseSystemPasswordChar = true;
|
|
this.m_CancelButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
this.m_CancelButton.DialogResult = DialogResult.Cancel;
|
|
Button mCancelButton1 = this.m_CancelButton;
|
|
point1 = new Point(218, 128);
|
|
Point point3 = point1;
|
|
mCancelButton1.Location = point3;
|
|
this.m_CancelButton.Name = "m_CancelButton";
|
|
Button mCancelButton2 = this.m_CancelButton;
|
|
size1 = new Size(72, 24);
|
|
Size size3 = size1;
|
|
mCancelButton2.Size = size3;
|
|
this.m_CancelButton.TabIndex = 10;
|
|
this.m_CancelButton.Text = "Cancel";
|
|
this.m_CancelButton.UseVisualStyleBackColor = true;
|
|
this.OKButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
Button okButton1 = this.OKButton;
|
|
point1 = new Point(138, 128);
|
|
Point point4 = point1;
|
|
okButton1.Location = point4;
|
|
this.OKButton.Name = "OKButton";
|
|
Button okButton2 = this.OKButton;
|
|
size1 = new Size(72, 24);
|
|
Size size4 = size1;
|
|
okButton2.Size = size4;
|
|
this.OKButton.TabIndex = 9;
|
|
this.OKButton.Text = "OK";
|
|
this.OKButton.UseVisualStyleBackColor = true;
|
|
this.Label1.AutoSize = true;
|
|
this.Label1.ForeColor = Color.Red;
|
|
Label label1_1 = this.Label1;
|
|
point1 = new Point(8, 24);
|
|
Point point5 = point1;
|
|
label1_1.Location = point5;
|
|
this.Label1.Name = "Label1";
|
|
Label label1_2 = this.Label1;
|
|
size1 = new Size(50, 12);
|
|
Size size5 = size1;
|
|
label1_2.Size = size5;
|
|
this.Label1.TabIndex = 1;
|
|
this.Label1.Text = "Message";
|
|
this.TextBoxNew.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox textBoxNew1 = this.TextBoxNew;
|
|
point1 = new Point(64, 72);
|
|
Point point6 = point1;
|
|
textBoxNew1.Location = point6;
|
|
this.TextBoxNew.Name = "TextBoxNew";
|
|
TextBox textBoxNew2 = this.TextBoxNew;
|
|
size1 = new Size(226, 19);
|
|
Size size6 = size1;
|
|
textBoxNew2.Size = size6;
|
|
this.TextBoxNew.TabIndex = 5;
|
|
this.TextBoxNew.UseSystemPasswordChar = true;
|
|
this.TextBoxConfirm.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox textBoxConfirm1 = this.TextBoxConfirm;
|
|
point1 = new Point(64, 96);
|
|
Point point7 = point1;
|
|
textBoxConfirm1.Location = point7;
|
|
this.TextBoxConfirm.Name = "TextBoxConfirm";
|
|
TextBox textBoxConfirm2 = this.TextBoxConfirm;
|
|
size1 = new Size(226, 19);
|
|
Size size7 = size1;
|
|
textBoxConfirm2.Size = size7;
|
|
this.TextBoxConfirm.TabIndex = 7;
|
|
this.TextBoxConfirm.UseSystemPasswordChar = true;
|
|
this.Label2.AutoSize = true;
|
|
Label label2_1 = this.Label2;
|
|
point1 = new Point(8, 48);
|
|
Point point8 = point1;
|
|
label2_1.Location = point8;
|
|
this.Label2.Name = "Label2";
|
|
Label label2_2 = this.Label2;
|
|
size1 = new Size(22, 12);
|
|
Size size8 = size1;
|
|
label2_2.Size = size8;
|
|
this.Label2.TabIndex = 2;
|
|
this.Label2.Text = "Old";
|
|
this.Label3.AutoSize = true;
|
|
Label label3_1 = this.Label3;
|
|
point1 = new Point(8, 72);
|
|
Point point9 = point1;
|
|
label3_1.Location = point9;
|
|
this.Label3.Name = "Label3";
|
|
Label label3_2 = this.Label3;
|
|
size1 = new Size(27, 12);
|
|
Size size9 = size1;
|
|
label3_2.Size = size9;
|
|
this.Label3.TabIndex = 4;
|
|
this.Label3.Text = "New";
|
|
this.Label4.AutoSize = true;
|
|
Label label4_1 = this.Label4;
|
|
point1 = new Point(8, 96);
|
|
Point point10 = point1;
|
|
label4_1.Location = point10;
|
|
this.Label4.Name = "Label4";
|
|
Label label4_2 = this.Label4;
|
|
size1 = new Size(45, 12);
|
|
Size size10 = size1;
|
|
label4_2.Size = size10;
|
|
this.Label4.TabIndex = 6;
|
|
this.Label4.Text = "Confirm";
|
|
this.Label5.AutoSize = true;
|
|
Label label5_1 = this.Label5;
|
|
point1 = new Point(8, 8);
|
|
Point point11 = point1;
|
|
label5_1.Location = point11;
|
|
this.Label5.Name = "Label5";
|
|
Label label5_2 = this.Label5;
|
|
size1 = new Size(193, 12);
|
|
Size size11 = size1;
|
|
label5_2.Size = size11;
|
|
this.Label5.TabIndex = 0;
|
|
this.Label5.Text = "Enter Old and New Master Password";
|
|
this.ButtonClear.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
Button buttonClear1 = this.ButtonClear;
|
|
point1 = new Point(58, 128);
|
|
Point point12 = point1;
|
|
buttonClear1.Location = point12;
|
|
this.ButtonClear.Name = "ButtonClear";
|
|
Button buttonClear2 = this.ButtonClear;
|
|
size1 = new Size(72, 24);
|
|
Size size12 = size1;
|
|
buttonClear2.Size = size12;
|
|
this.ButtonClear.TabIndex = 8;
|
|
this.ButtonClear.Text = "Clear";
|
|
this.ButtonClear.UseVisualStyleBackColor = true;
|
|
this.AcceptButton = (IButtonControl) this.OKButton;
|
|
this.AutoScaleDimensions = new SizeF(6f, 12f);
|
|
this.AutoScaleMode = AutoScaleMode.Font;
|
|
this.CancelButton = (IButtonControl) this.m_CancelButton;
|
|
size1 = new Size(299, 161);
|
|
this.ClientSize = size1;
|
|
this.Controls.Add((Control) this.Label5);
|
|
this.Controls.Add((Control) this.Label4);
|
|
this.Controls.Add((Control) this.Label3);
|
|
this.Controls.Add((Control) this.Label2);
|
|
this.Controls.Add((Control) this.Label1);
|
|
this.Controls.Add((Control) this.m_CancelButton);
|
|
this.Controls.Add((Control) this.ButtonClear);
|
|
this.Controls.Add((Control) this.OKButton);
|
|
this.Controls.Add((Control) this.TextBoxConfirm);
|
|
this.Controls.Add((Control) this.TextBoxNew);
|
|
this.Controls.Add((Control) this.TextBoxPassword);
|
|
this.FormBorderStyle = FormBorderStyle.FixedDialog;
|
|
this.MaximizeBox = false;
|
|
this.MinimizeBox = false;
|
|
size1 = new Size(305, 125);
|
|
this.MinimumSize = size1;
|
|
this.Name = nameof (MasterPasswordChangeForm);
|
|
this.StartPosition = FormStartPosition.CenterParent;
|
|
this.Text = "Change Master Password";
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
}
|
|
|
|
internal virtual TextBox TextBoxPassword
|
|
{
|
|
get
|
|
{
|
|
return this._TextBoxPassword;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.TextBoxPassword_TextChanged);
|
|
if (this._TextBoxPassword != null)
|
|
this._TextBoxPassword.TextChanged -= eventHandler;
|
|
this._TextBoxPassword = value;
|
|
if (this._TextBoxPassword == null)
|
|
return;
|
|
this._TextBoxPassword.TextChanged += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual Button m_CancelButton
|
|
{
|
|
get
|
|
{
|
|
return this._m_CancelButton;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._m_CancelButton = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Button OKButton
|
|
{
|
|
get
|
|
{
|
|
return this._OKButton;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.OKButton_Click);
|
|
if (this._OKButton != null)
|
|
this._OKButton.Click -= eventHandler;
|
|
this._OKButton = value;
|
|
if (this._OKButton == null)
|
|
return;
|
|
this._OKButton.Click += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label1
|
|
{
|
|
get
|
|
{
|
|
return this._Label1;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label1 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox TextBoxNew
|
|
{
|
|
get
|
|
{
|
|
return this._TextBoxNew;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.TextBoxNew_TextChanged);
|
|
if (this._TextBoxNew != null)
|
|
this._TextBoxNew.TextChanged -= eventHandler;
|
|
this._TextBoxNew = value;
|
|
if (this._TextBoxNew == null)
|
|
return;
|
|
this._TextBoxNew.TextChanged += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox TextBoxConfirm
|
|
{
|
|
get
|
|
{
|
|
return this._TextBoxConfirm;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.TextBoxNew_TextChanged);
|
|
if (this._TextBoxConfirm != null)
|
|
this._TextBoxConfirm.TextChanged -= eventHandler;
|
|
this._TextBoxConfirm = value;
|
|
if (this._TextBoxConfirm == null)
|
|
return;
|
|
this._TextBoxConfirm.TextChanged += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label2
|
|
{
|
|
get
|
|
{
|
|
return this._Label2;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label2 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label3
|
|
{
|
|
get
|
|
{
|
|
return this._Label3;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label3 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label4
|
|
{
|
|
get
|
|
{
|
|
return this._Label4;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label4 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label5
|
|
{
|
|
get
|
|
{
|
|
return this._Label5;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label5 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Button ButtonClear
|
|
{
|
|
get
|
|
{
|
|
return this._ButtonClear;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.ButtonClear_Click);
|
|
if (this._ButtonClear != null)
|
|
this._ButtonClear.Click -= eventHandler;
|
|
this._ButtonClear = value;
|
|
if (this._ButtonClear == null)
|
|
return;
|
|
this._ButtonClear.Click += eventHandler;
|
|
}
|
|
}
|
|
|
|
public string NewMasterPassword
|
|
{
|
|
get
|
|
{
|
|
return this.TextBoxNew.Text;
|
|
}
|
|
set
|
|
{
|
|
this.TextBoxNew.Text = value;
|
|
}
|
|
}
|
|
|
|
private void MasterPasswordChangeForm_Load(object sender, EventArgs e)
|
|
{
|
|
this.Icon = CarotDAV.My.Resources.Resources.security;
|
|
if (string.IsNullOrEmpty(this.MasterPassword))
|
|
{
|
|
this.TextBoxPassword.Enabled = false;
|
|
this.OKButton.Enabled = false;
|
|
this.ButtonClear.Visible = false;
|
|
this.Label1.Text = "";
|
|
}
|
|
else
|
|
{
|
|
this.TextBoxPassword.Enabled = !string.IsNullOrEmpty(this.MasterPassword);
|
|
this.OKButton.Enabled = false;
|
|
this.ButtonClear.Enabled = this.TextBoxPassword.Text.Length > 0;
|
|
this.ButtonClear.Visible = true;
|
|
this.Label1.Text = "";
|
|
}
|
|
}
|
|
|
|
private void TextBoxPassword_TextChanged(object sender, EventArgs e)
|
|
{
|
|
this.OKButton.Enabled = Operators.CompareString(this.TextBoxNew.Text, this.TextBoxConfirm.Text, false) == 0 && this.TextBoxNew.Text.Length > 0 && (string.IsNullOrEmpty(this.MasterPassword) || this.TextBoxPassword.Text.Length > 0);
|
|
this.ButtonClear.Enabled = this.TextBoxPassword.Text.Length > 0;
|
|
}
|
|
|
|
private void TextBoxNew_TextChanged(object sender, EventArgs e)
|
|
{
|
|
this.OKButton.Enabled = Operators.CompareString(this.TextBoxNew.Text, this.TextBoxConfirm.Text, false) == 0 && this.TextBoxNew.Text.Length > 0 && (string.IsNullOrEmpty(this.MasterPassword) || this.TextBoxPassword.Text.Length > 0);
|
|
}
|
|
|
|
private void OKButton_Click(object sender, EventArgs e)
|
|
{
|
|
if (Operators.CompareString(this.TextBoxPassword.Text, this.MasterPassword, false) == 0)
|
|
this.DialogResult = DialogResult.OK;
|
|
else
|
|
this.Label1.Text = "Enter Valid Master Password";
|
|
}
|
|
|
|
private void ButtonClear_Click(object sender, EventArgs e)
|
|
{
|
|
if (Operators.CompareString(this.TextBoxPassword.Text, this.MasterPassword, false) == 0)
|
|
{
|
|
this.TextBoxNew.Text = (string) null;
|
|
this.DialogResult = DialogResult.OK;
|
|
}
|
|
else
|
|
this.Label1.Text = "Enter Valid Master Password";
|
|
}
|
|
}
|
|
}
|