/// <summary> /// Allows programmatic addition to the Collection /// </summary> /// <param name="element">Element to add to collection</param> public void Add(TargetDatabaseConfigElement element) { if (element == null) { throw new ArgumentNullException("element"); } BaseAdd(element, true); }
/// <summary> /// Allows programmatic addition to the Collection /// </summary> /// <param name="element">Element to add to collection</param> public void Add(TargetDatabaseConfigElement element) { if (element == null) { throw new ArgumentNullException("element"); } base.BaseAdd(element, true); }
private void saveBtn_Click(object sender, EventArgs e) { // First test connection if (this.TestConnection()) { // Now add this to the Target database list if (string.IsNullOrEmpty(this.cfgNameTxtBox.Text)) { MessageBox.Show("Please enter a valid name for Config Name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.cfgNameTxtBox.Focus(); } if (addMode) { TargetDatabaseConfigElement db = new TargetDatabaseConfigElement() { Name = this.cfgNameTxtBox.Text, UseIntegratedAuth = this.useIntAuthRadioBtn.Checked, UserName = this.unameTxtBox.Text, Password = this.pwdTextBox.Text, DbServer = this.dbServerTxtBox.Text, DbName = this.dbNameTxtBox.Text }; WizardHelper.Instance.SyncConfigSection.Databases.Add(db); ReadAndBindData(); } else { TargetDatabaseConfigElement db = WizardHelper.Instance.SyncConfigSection.Databases.GetElementAt(this.dbListBox.SelectedIndex); db.Name = this.cfgNameTxtBox.Text; db.UseIntegratedAuth = this.useIntAuthRadioBtn.Checked; db.UserName = this.unameTxtBox.Text; db.Password = this.pwdTextBox.Text; db.DbServer = this.dbServerTxtBox.Text; db.DbName = this.dbNameTxtBox.Text; } this.dbSettingsGrp.Enabled = false; } }