private void addHorseToolStripMenuItem_Click(object sender, EventArgs e) { var selHerd = selectedHerd; if (selHerd == null) MessageBox.Show("select a herd first"); else { FormHorseViewEdit ui = new FormHorseViewEdit(MainForm, null, Context, HorseViewEditOpType.New, selHerd.HerdID); ui.ShowDialog(); } }
private void viewToolStripMenuItem_Click(object sender, EventArgs e) { if (objectListView1.SelectedObjects.Count > 1) MessageBox.Show("Select a single horse for viewing"); else { var selected = objectListView1.SelectedObjects.Cast<Horse>().ToArray(); foreach (var horse in selected) { FormHorseViewEdit ui = new FormHorseViewEdit(MainForm, horse, Context, HorseViewEditOpType.View, horse.HerdAspect); ui.ShowDialog(); } } }