예제 #1
0
        private void SavePassword_FormClosing(object sender, FormClosingEventArgs e)
        {
            PasswordList pList = new PasswordList();

            lblStatus.Text = string.Empty;
            txtTitle.Text  = string.Empty;
            txtCustom.Text = string.Empty;
            pList.dgvPasswordList.DataSource = p.GetDataTable();
        }
예제 #2
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.S)
     {
         PasswordList pList = new PasswordList();
         pList.ShowDialog();
     }
     else if (e.Control && e.KeyCode == Keys.C)
     {
         if (lstGenerated.SelectedItems.OfType <string>().ToArray().Length > 0)
         {
             Clipboard.SetText(string.Join(Environment.NewLine, lstGenerated.SelectedItems.OfType <string>().ToArray()));
             lblOutput.ForeColor = Color.Green;
             lblOutput.Text      = "Password Copied :)";
         }
         else
         {
             lblOutput.ForeColor = Color.Red;
             lblOutput.Text      = "You're click empty area!\nPlease select password :)";
         }
     }
     else if (e.Control && e.KeyCode == Keys.P)
     {
         string generatedPassword = string.Join(Environment.NewLine, lstGenerated.SelectedItems.OfType <string>().ToArray());
         if (generatedPassword != string.Empty)
         {
             savePassword.txtPassword.Text = generatedPassword;
             savePassword.ShowDialog();
         }
         else
         {
             savePassword.ShowDialog();
         }
     }
     else if (e.Control && e.KeyCode == Keys.G)
     {
         btnGenerate.PerformClick();
         lstGenerated.Focus();
         lstGenerated.Select();
     }
     else if (e.KeyCode == Keys.Up)
     {
         if (lstGenerated.SelectedIndex > 0)
         {
             lstGenerated.SelectedIndex--;
         }
         e.Handled = true;
     }
     else if (e.KeyCode == Keys.Down)
     {
         if (lstGenerated.SelectedIndex < (lstGenerated.Items.Count - 1))
         {
             lstGenerated.SelectedIndex++;
         }
         e.Handled = true;
     }
     else if (e.Alt && e.KeyCode == Keys.L)
     {
         e.SuppressKeyPress = true;
         if (!chkLower.Checked)
         {
             chkLower.Checked = true;
         }
         else
         {
             chkLower.Checked = false;
         }
     }
     else if (e.Alt && e.KeyCode == Keys.U)
     {
         e.SuppressKeyPress = true;
         if (!chkUpper.Checked)
         {
             chkUpper.Checked = true;
         }
         else
         {
             chkUpper.Checked = false;
         }
     }
     else if (e.Alt && e.KeyCode == Keys.N)
     {
         e.SuppressKeyPress = true;
         if (!chkNumeric.Checked)
         {
             chkNumeric.Checked = true;
         }
         else
         {
             chkNumeric.Checked = false;
         }
     }
     else if (e.Alt && e.KeyCode == Keys.S)
     {
         e.SuppressKeyPress = true;
         if (!chkSpecial.Checked)
         {
             chkSpecial.Checked = true;
         }
         else
         {
             chkSpecial.Checked = false;
         }
     }
     else if (e.Control && e.KeyCode == Keys.H)
     {
         HelpDocument help = new HelpDocument();
         help.ShowDialog();
     }
     else if (e.Alt)
     {
         e.SuppressKeyPress = true;
     }
     else if (e.Control && e.KeyCode == Keys.E)
     {
         Application.Exit();
     }
 }
예제 #3
0
        private void lnkLblShowPassword_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PasswordList pl = new PasswordList();

            pl.ShowDialog();
        }