private void arrangementEditButton_Click(object sender, EventArgs e) { if (ArrangementLB.SelectedItem != null) { var arrangement = (Arrangement)ArrangementLB.SelectedItem; using (var form = new ArrangementForm(arrangement, (DLCPackageCreator)this, CurrentGameVersion) { Text = "Edit Arrangement" }) { if (DialogResult.OK != form.ShowDialog()) { return; } } ArrangementLB.Items[ArrangementLB.SelectedIndex] = arrangement; } }
public void arrangementAddButton_Click(object sender = null, EventArgs e = null) { Arrangement arrangement; using (var form = new ArrangementForm((DLCPackageCreator)this, CurrentGameVersion)) { if (DialogResult.OK != form.ShowDialog()) { return; } arrangement = form.Arrangement; } if (arrangement == null) return; ArrangementLB.Items.Add(arrangement); }