private void DeleteEntry_Click(object sender, RoutedEventArgs e) { PasswordModel passwordToDelete = (PasswordModel)passwordListView.SelectedItem; _context.DeleteEntry(passwordToDelete); LoadItemList(); }
public void DeleteEntry(PasswordModel passwordToDelete) { using (SQLiteConnection cnn = new SQLiteConnection(App.passwordDbPath)) { cnn.CreateTable <PasswordModel>(); cnn.Delete(passwordToDelete); } }
public void SaveEntry(PasswordModel newPassword) { if (newPassword.Password != null) { using (SQLiteConnection cnn = new SQLiteConnection(App.passwordDbPath)) { cnn.CreateTable <PasswordModel>(); cnn.Insert(newPassword); } } }
private void SaveEntry_Click(object sender, RoutedEventArgs e) { PasswordModel newPassword = new PasswordModel { Password = newEntryTextBox.Text }; // save Entry _context.SaveEntry(newPassword); LoadItemList(); newEntryTextBox.Text = string.Empty; }
private void SaveEntry_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { PasswordModel newPassword = new PasswordModel { Password = newEntryTextBox.Text }; if (e.Key == System.Windows.Input.Key.Return) { _context.SaveEntry(newPassword); LoadItemList(); newEntryTextBox.Text = string.Empty; } }
private void CopyEntry_DoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { PasswordModel password = (PasswordModel)passwordListView.SelectedItem; try { if (password != null) { Clipboard.SetDataObject(password.Password); } } catch (Exception ex) { } }
private void CopyEntry_Click(object sender, RoutedEventArgs e) { PasswordModel password = (PasswordModel)passwordListView.SelectedItem; Clipboard.SetDataObject(password.Password); }