Improved FrmPasswordRecovery

This commit is contained in:
MaxXor 2015-08-02 21:23:32 +02:00
parent f70a7511d2
commit c505dbd925
3 changed files with 48 additions and 55 deletions

View File

@ -43,15 +43,14 @@ private void InitializeComponent()
this.selectedToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.sfdPasswords = new System.Windows.Forms.SaveFileDialog();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.txtFormat = new System.Windows.Forms.TextBox();
this.lstPasswords = new xServer.Controls.AeroListView();
this.hIdentification = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hUser = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hPass = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.txtFormat = new System.Windows.Forms.TextBox();
this.menuMain.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -163,12 +162,42 @@ private void InitializeComponent()
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Password Data";
//
// sfdPasswords
// lstPasswords
//
this.sfdPasswords.Filter = "Text Files|*.txt|All files|*.*";
this.sfdPasswords.RestoreDirectory = true;
this.sfdPasswords.SupportMultiDottedExtensions = true;
this.sfdPasswords.Title = "Save Passwords to File...";
this.lstPasswords.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hIdentification,
this.hURL,
this.hUser,
this.hPass});
this.lstPasswords.ContextMenuStrip = this.menuMain;
this.lstPasswords.FullRowSelect = true;
this.lstPasswords.HideSelection = false;
this.lstPasswords.Location = new System.Drawing.Point(6, 19);
this.lstPasswords.Name = "lstPasswords";
this.lstPasswords.Size = new System.Drawing.Size(537, 300);
this.lstPasswords.TabIndex = 0;
this.lstPasswords.UseCompatibleStateImageBehavior = false;
this.lstPasswords.View = System.Windows.Forms.View.Details;
//
// hIdentification
//
this.hIdentification.Text = "Identification";
this.hIdentification.Width = 107;
//
// hURL
//
this.hURL.Text = "URL / Location";
this.hURL.Width = 151;
//
// hUser
//
this.hUser.Text = "Username";
this.hUser.Width = 142;
//
// hPass
//
this.hPass.Text = "Password";
this.hPass.Width = 130;
//
// groupBox2
//
@ -202,44 +231,6 @@ private void InitializeComponent()
this.txtFormat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtFormat.TextChanged += new System.EventHandler(this.txtFormat_TextChanged);
//
// lstPasswords
//
this.lstPasswords.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hIdentification,
this.hURL,
this.hUser,
this.hPass});
this.lstPasswords.ContextMenuStrip = this.menuMain;
this.lstPasswords.FullRowSelect = true;
this.lstPasswords.GridLines = true;
this.lstPasswords.HideSelection = false;
this.lstPasswords.Location = new System.Drawing.Point(6, 19);
this.lstPasswords.Name = "lstPasswords";
this.lstPasswords.Size = new System.Drawing.Size(537, 300);
this.lstPasswords.TabIndex = 0;
this.lstPasswords.UseCompatibleStateImageBehavior = false;
this.lstPasswords.View = System.Windows.Forms.View.Details;
//
// hIdentification
//
this.hIdentification.Text = "Identification";
this.hIdentification.Width = 107;
//
// hURL
//
this.hURL.Text = "URL / Location";
this.hURL.Width = 151;
//
// hUser
//
this.hUser.Text = "Username";
this.hUser.Width = 142;
//
// hPass
//
this.hPass.Text = "Password";
this.hPass.Width = 130;
//
// FrmPasswordRecovery
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -279,7 +270,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem selectedToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem allToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem selectedToolStripMenuItem1;
private System.Windows.Forms.SaveFileDialog sfdPasswords;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtFormat;

View File

@ -174,20 +174,26 @@ public ListViewGroup GetGroupFromApplication(string app)
private void allToolStripMenuItem_Click(object sender, EventArgs e)
{
StringBuilder sb = GetLoginData();
using (var sfdPasswords = new SaveFileDialog())
{
if (sfdPasswords.ShowDialog() == DialogResult.OK)
{
File.WriteAllText(sfdPasswords.FileName, sb.ToString());
}
}
}
private void selectedToolStripMenuItem_Click(object sender, EventArgs e)
{
StringBuilder sb = GetLoginData(true);
using (var sfdPasswords = new SaveFileDialog())
{
if (sfdPasswords.ShowDialog() == DialogResult.OK)
{
File.WriteAllText(sfdPasswords.FileName, sb.ToString());
}
}
}
#endregion
#region Clipboard Copying
private void allToolStripMenuItem1_Click(object sender, EventArgs e)

View File

@ -120,9 +120,6 @@
<metadata name="menuMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="sfdPasswords.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>