private void addToExistingRunnersButton_Click(object sender, EventArgs e) { if (RunnerAliasesHelper.AddRunner(newRunnerNameTextBox.Text)) { LoadData(existingRunnersListBox.Items.Count); } }
private void addAliasButton_Click(object sender, EventArgs e) { if (RunnerAliasesHelper.AddAlias(newAliasTextBox.Text, existingRunnersListBox.SelectedItem.ToString())) { LoadData(existingRunnersListBox.SelectedIndex); } }
private void LoadData(int selectedRunnerIndex = 0, bool clearTextBoxes = true) { _runnerAliases = RunnerAliasesHelper.LoadAllRunners(); existingRunnersListBox.DataSource = _runnerAliases.Keys.ToList(); existingRunnersListBox.SelectedIndex = selectedRunnerIndex; newRunnerNameTextBox.Text = string.Empty; newAliasTextBox.Text = string.Empty; SetAliases(); }