private void Button_Click_Copy(object sender, RoutedEventArgs e) { ServiceLoginPassword dataRowView = (ServiceLoginPassword)((Button)e.Source).DataContext; Clipboard.SetText(dataRowView.Password.Password); ClearTimer timer = new ClearTimer(3000, statusBar, copy_to_clipboard_string); }
public EditDataWindow(ServiceLoginPassword serviceLoginPassword) { InitializeComponent(); PasswordM1.Password = serviceLoginPassword.Password; PasswordM2.Password = serviceLoginPassword.Password; ServiceName.Text = serviceLoginPassword.ServiceName; Login.Text = serviceLoginPassword.Login; }
private void Button_Click_Remove(object sender, RoutedEventArgs e) { ServiceLoginPassword dataRowView = (ServiceLoginPassword)((Button)e.Source).DataContext; MessageBoxResult result = MessageBox.Show(delete_row_string, delete_string, MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { items.Remove(dataRowView); ItemList.Items.Refresh(); storeData(); ClearTimer timer = new ClearTimer(3000, statusBar, remove_string); } }
private void Button_Click_Edit(object sender, RoutedEventArgs e) { ServiceLoginPassword dataRowView = (ServiceLoginPassword)((Button)e.Source).DataContext; EditDataWindow window = new EditDataWindow(dataRowView); if (window.ShowDialog() == true) { if (dataRowView.ServiceName.Equals(window.serviceLoginPassword.ServiceName) && dataRowView.Login.Equals(window.serviceLoginPassword.Login) && dataRowView.Password.Password.Equals(window.serviceLoginPassword.Password.Password)) { return; } dataRowView.ServiceName = window.serviceLoginPassword.ServiceName; dataRowView.Login = window.serviceLoginPassword.Login; dataRowView.Password = window.serviceLoginPassword.Password; ItemList.Items.Refresh(); storeData(); ClearTimer timer = new ClearTimer(3000, statusBar, change_string); } }
private void enter_Changes(object sender, RoutedEventArgs e) { string password1 = PasswordM1.Password.Password; string password2 = PasswordM2.Password.Password; if (!password1.Equals(password2)) { MessageBox.Show(different_passwords, different_passwords, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (password1.Length == 0 || password2.Length == 0) { MessageBox.Show(empty_password_string, empty_password_string, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (password1.Contains(" ") || password2.Contains(" ")) { MessageBox.Show(space_password_string, space_password_string, MessageBoxButton.OK, MessageBoxImage.Error); return; } serviceLoginPassword = new ServiceLoginPassword(ServiceName.Text, Login.Text, password1); this.DialogResult = true; }