public void AddLoss() { using (var dlg = new EditFragmentLossDlg(Losses.ToArray())) { if (dlg.ShowDialog(this) == DialogResult.OK) { Losses = new List <FragmentLoss>(Losses) { dlg.Loss }; listNeutralLosses.SelectedItem = dlg.Loss; } } }
public void EditLoss() { var lossEdit = (FragmentLoss)listNeutralLosses.SelectedItem; var listLosses = new List <FragmentLoss>(Losses); listLosses.Remove(lossEdit); using (var dlg = new EditFragmentLossDlg(listLosses) { Loss = lossEdit }) { if (dlg.ShowDialog(this) == DialogResult.OK) { listLosses.Add(dlg.Loss); Losses = listLosses; listNeutralLosses.SelectedItem = dlg.Loss; } } }
public void EditLoss() { var lossEdit = (FragmentLoss) listNeutralLosses.SelectedItem; var listLosses = new List<FragmentLoss>(Losses); listLosses.Remove(lossEdit); using (var dlg = new EditFragmentLossDlg(listLosses) { Loss = lossEdit }) { if (dlg.ShowDialog(this) == DialogResult.OK) { listLosses.Add(dlg.Loss); Losses = listLosses; listNeutralLosses.SelectedItem = dlg.Loss; } } }
public void AddLoss() { using (var dlg = new EditFragmentLossDlg(Losses.ToArray())) { if (dlg.ShowDialog(this) == DialogResult.OK) { Losses = new List<FragmentLoss>(Losses) {dlg.Loss}; listNeutralLosses.SelectedItem = dlg.Loss; } } }