private void buttonSave_Click(object sender, EventArgs e) { string passwordToRemove = this.textBoxPassword.Text; if (this.editPanel.Tag != null) { PasswordManagerControlListItem pi = (PasswordManagerControlListItem)this.editPanel.Tag; passwordToRemove = pi.Password.ActualPassword; } this.pm.Remove(passwordToRemove); // just in case the same password already exists Growl.Connector.Password p = new Growl.Connector.Password(this.textBoxPassword.Text, this.textBoxDescription.Text, true); this.pm.Add(p); RefreshItems(); this.editPanel.Tag = null; this.editPanel.Visible = false; this.OnUpdated(); }
private void passwordListBox_MouseMove(object sender, MouseEventArgs e) { int index = this.passwordListBox.IndexFromPoint(e.Location); if (index != ListBox.NoMatches) { if (index != this.currentTooltipItem) { this.currentTooltipItem = index; PasswordManagerControlListItem pi = (PasswordManagerControlListItem)this.passwordListBox.Items[index]; this.tooltip.Show(pi.Password.Description, this.passwordListBox, e.Location, 2000); } // otherwise, dont keep moving the tooltip around } else { this.tooltip.Hide(this.passwordListBox); this.currentTooltipItem = NONE; } }
private void buttonRemovePassword_Click(object sender, EventArgs e) { if (this.passwordListBox.SelectedIndex != ListBox.NoMatches) { PasswordManagerControlListItem pi = (PasswordManagerControlListItem)this.passwordListBox.Items[this.passwordListBox.SelectedIndex]; this.pm.Remove(pi.Password.ActualPassword); this.passwordListBox.Items.RemoveAt(this.passwordListBox.SelectedIndex); this.passwordListBox.ClearSelected(); this.OnUpdated(); } }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (this.passwordListBox.SelectedIndex != ListBox.NoMatches) { PasswordManagerControlListItem pi = (PasswordManagerControlListItem)this.contextMenuEdit.Tag; this.textBoxPassword.Text = pi.Password.ActualPassword; this.textBoxDescription.Text = pi.Password.Description; ValidateInputs(); this.editPanel.Tag = pi; this.editPanel.Visible = true; } }
private void RefreshItems() { this.passwordListBox.SuspendLayout(); this.passwordListBox.Items.Clear(); foreach (Growl.Connector.Password password in this.pm.Passwords.Values) { if (password.Permanent) { PasswordManagerControlListItem pi = new PasswordManagerControlListItem(password); this.passwordListBox.Items.Add(pi); } } this.passwordListBox.ResumeLayout(); }
private void RefreshItems() { this.passwordListBox.SuspendLayout(); this.passwordListBox.Items.Clear(); foreach (Growl.Connector.Password password in this.pm.Passwords.Values) { if (password.Permanent) { PasswordManagerControlListItem pi = new PasswordManagerControlListItem(password); this.passwordListBox.Items.Add(pi); } } this.passwordListBox.ResumeLayout(); }