private void AddStationButton_Click(object sender, EventArgs e)
        {
            if (SystemComboBox.Items.Count == 0)
                return;

            AddStationDialog dialog = new AddStationDialog(gameData.StarSystems[SystemComboBox.SelectedIndex].Name);
            dialog.ShowDialog();

            if (dialog.Result == null)
                return;

            gameData.StarSystems[SystemComboBox.SelectedIndex].Stations.Add(dialog.Result);
            StationComboBox.Items.Add(dialog.Result.Name);

            StationComboBox.SelectedIndex = StationComboBox.Items.Count - 1;
        }
示例#2
0
        private void AddStationButton_Click(object sender, EventArgs e)
        {
            if (SystemComboBox.Items.Count == 0)
            {
                return;
            }

            AddStationDialog dialog = new AddStationDialog(gameData.StarSystems[SystemComboBox.SelectedIndex].Name);

            dialog.ShowDialog();

            if (dialog.Result == null)
            {
                return;
            }

            gameData.StarSystems[SystemComboBox.SelectedIndex].Stations.Add(dialog.Result);
            StationComboBox.Items.Add(dialog.Result.Name);

            StationComboBox.SelectedIndex = StationComboBox.Items.Count - 1;
        }