private void btnSave_Click(object sender, EventArgs e) { if (!IsValidTFSConfiguration()) { return; } try { TFSConnectionString newtfsConnectionString = new TFSConnectionString { ServerName = this.txtServerName.Text, PortNumber = int.Parse(this.txtPortNumber.Text), DefaultCollection = this.txtDefaultCollection.Text }; newtfsConnectionString.Validate(); newtfsConnectionString.SaveOrUpdateTFSConnectionStringToDB(); this.Close(); } catch (ArgumentNullException argumentex) { MessageBox.Show(argumentex.Message, "Invalid TFS connection parameters", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FormatException formatException) { MessageBox.Show(formatException.Message, "Invalid TFS connection parameters", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Invalid TFS connection parameters", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public TFSConnectionEditor(TFSConnectionString tfsConectionString) : this() { tfsConectionString.Validate(); this.txtServerName.Text = tfsConectionString.ServerName; this.txtPortNumber.Text = tfsConectionString.PortNumber.ToString(); this.txtDefaultCollection.Text = tfsConectionString.DefaultCollection; }