private void AddSystemButton_Click(object sender, System.EventArgs e) { AddSystemDialog dialog = new AddSystemDialog(); dialog.ShowDialog(); if (dialog.Result == null) return; StarSystem newSystem = dialog.Result; gameData.StarSystems.Add(newSystem); SystemComboBox.Items.Add(newSystem.Name); SystemComboBox.SelectedIndex = SystemComboBox.Items.Count - 1; }
private void AddSystemButton_Click(object sender, System.EventArgs e) { AddSystemDialog dialog = new AddSystemDialog(); dialog.ShowDialog(); if (dialog.Result == null) { return; } StarSystem newSystem = dialog.Result; gameData.StarSystems.Add(newSystem); SystemComboBox.Items.Add(newSystem.Name); SystemComboBox.SelectedIndex = SystemComboBox.Items.Count - 1; }