private void ShowNewForm(object sender, EventArgs e) { using (ShipSelector select = new ShipSelector()) { select.ShowDialog(); if (select.DialogResult == DialogResult.OK) { string selection = select.SelectedShipName; Ship findShip = Program.AllShips.Find(x => x.Name == selection); AddShipToCompare(findShip); } } }
private void DoShipSelect() { using (ShipSelector select = new ShipSelector()) { select.Text = "Select ship"; select.ShowDialog(); if (select.DialogResult == DialogResult.OK) { string selection = select.SelectedShipName; Ship findShip = Program.AllShips.Find(x => x.Name == selection); SelectShip(findShip); } } }