コード例 #1
0
        private void DeleteEntry_Click(object sender, RoutedEventArgs e)
        {
            PasswordModel passwordToDelete = (PasswordModel)passwordListView.SelectedItem;

            _context.DeleteEntry(passwordToDelete);
            LoadItemList();
        }
コード例 #2
0
        public void DeleteEntry(PasswordModel passwordToDelete)
        {
            using (SQLiteConnection cnn = new SQLiteConnection(App.passwordDbPath))
            {
                cnn.CreateTable <PasswordModel>();

                cnn.Delete(passwordToDelete);
            }
        }
コード例 #3
0
        public void SaveEntry(PasswordModel newPassword)
        {
            if (newPassword.Password != null)
            {
                using (SQLiteConnection cnn = new SQLiteConnection(App.passwordDbPath))
                {
                    cnn.CreateTable <PasswordModel>();

                    cnn.Insert(newPassword);
                }
            }
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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)
            {
            }
        }
コード例 #7
0
        private void CopyEntry_Click(object sender, RoutedEventArgs e)
        {
            PasswordModel password = (PasswordModel)passwordListView.SelectedItem;

            Clipboard.SetDataObject(password.Password);
        }