コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 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);
         }
     }
 }