private void ImportFormLoad(object sender, EventArgs e) { ProfileContainer = ProfileContainer.Get(); comboBoxProfiles.DataSource = ProfileContainer.Profiles; comboBoxProfiles.DisplayMember = "Name"; textBoxSource.Text = Options.Source; menuItemRegisterAutoplay.Checked = AutoPlayRegistration.IsRegistered(Registry.CurrentUser); }
private void ButtonEditClick(object sender, EventArgs e) { var form = new ProfileForm { ProfileContainer = ProfileContainer.Clone() }; if (form.ShowDialog(this) == DialogResult.OK) { ProfileContainer = form.ProfileContainer; var selected = ((Profile)comboBoxProfiles.SelectedItem).Name; comboBoxProfiles.DataSource = ProfileContainer.Profiles; comboBoxProfiles.DisplayMember = "Name"; comboBoxProfiles.SelectedItem = ProfileContainer.Profiles.FirstOrDefault(p => p.Name == selected); } }