private void okButton_Click(object sender, System.EventArgs e) { if (Title == string.Empty) { UserMessage.Display("No title entered", "Error"); return; } tabSettings.Tabs.AddNewTab(Title); DialogResult = DialogResult.OK; this.Close(); }
private void okButton_Click(object sender, System.EventArgs e) { configurationName = configurationNameTextBox.Text; if (configurationName == string.Empty) { UserMessage.Display("No configuration name provided", "Configuration Name Error"); return; } if (project.Configs.Contains(configurationName)) { // TODO: Need general error message display UserMessage.Display("A configuration with that name already exists", "Configuration Name Error"); return; } // ToDo: Move more of this to project ProjectConfig newConfig = new ProjectConfig(configurationName); copyConfigurationName = null; if (configurationComboBox.SelectedIndex > 0) { copyConfigurationName = (string)configurationComboBox.SelectedItem; ProjectConfig copyConfig = project.Configs[copyConfigurationName]; if (copyConfig != null) { foreach (string assembly in copyConfig.Assemblies) { newConfig.Assemblies.Add(assembly); } } } project.Configs.Add(newConfig); DialogResult = DialogResult.OK; Close(); }