private void ButtonAddProfile_Click(object sender, EventArgs args) { try { FormEditProfile addProfile = new FormEditProfile(this); addProfile.ShowDialog(this); } catch (Exception e) { MessageBox.Show(e.Message); } }
private void EditSelectedProfileName() { try { FormEditProfile edit = new FormEditProfile(this, Profiles.Find(p => p.Id == (int)listViewProfile.SelectedItems[0].Tag)); edit.ShowDialog(this); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Select a profile for editing."); } catch (Exception e) { MessageBox.Show($"Error: {e.Message}"); } }