void CreateNewProfile() { FormNewProfile formNewProfile = new FormNewProfile(); formNewProfile.ShowDialog(); string profileName = formNewProfile.ProfileName; if (profileName != "") { Profile p = new Profile(profileName); _profileList.Add(p); comboBox2.DataSource = null; comboBox2.DataSource = _profileList; comboBox2.SelectedItem = p; } }
private void AddProfile_Click(object sender, EventArgs e) { var dialog = new FormNewProfile(); if (dialog.ShowDialog() == DialogResult.OK) { if (!string.IsNullOrEmpty(dialog.profileName)) { Profile p = new Profile(dialog.profileName); profileList.Add(p); profileComboBox.DataSource = null; profileComboBox.DataSource = profileList; profileComboBox.SelectedItem = p; } } }
void createNewProfile() { FormNewProfile formNewProfile = new FormNewProfile(); formNewProfile.ShowDialog(); string profileName = formNewProfile.profileName; if (profileName != "") { Profile p = new Profile(profileName); profileList.Add(p); comboBox2.DataSource = null; comboBox2.DataSource = profileList; comboBox2.SelectedItem = p; } }
private void createNewProfile() { FormNewProfile formNewProfile = new FormNewProfile(); formNewProfile.ShowDialog(); string profileName = formNewProfile.profileName; if (profileName != "") { Profile p = new Profile(profileName); _ProfileList.Add(p); ComboProfiles.DataSource = null; ComboProfiles.DataSource = _ProfileList; ComboProfiles.SelectedItem = p; } }