private void addProfileToolStripMenuItem_Click(object sender, EventArgs e) { using (var form = new EditProfile(null)) { form.ShowDialog(); } }
private void ProfileListBox_DoubleClick(object sender, EventArgs e) { if (ProfileListBox.SelectedItem != null) { var p = _profiles.FirstOrDefault(pro => pro.Name == ProfileListBox.SelectedItem.ToString()); if (p != null) { using (var form = new EditProfile(p)) { form.ShowDialog(); } } } }