/// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BtnSave_Click(object sender, EventArgs e)
        {
            // This ensures proper values for database
            if (!this.IsValidTFSConfiguration())
            {
                return;
            }

            // throw any kind of db error. Don't show here since this is a dialog.
            try
            {
                TFSConnectionString newtfsConnectionString = new TFSConnectionString
                {
                    IsHttps = this.rbtHttps.Checked,
                    ServerName = this.txtServerName.Text,
                    PortNumber = int.Parse(this.txtPortNumber.Text),
                    DefaultCollection = this.txtDefaultCollection.Text
                };

                newtfsConnectionString.Validate();
                newtfsConnectionString.SaveOrUpdateTFSConnectionStringToDB(!this.txtServerName.ReadOnly);
                this.Close();
            }
            catch (InvalidOperationException ex)
            {
                ex.ShowUIException();
            }
            catch (ArgumentException ex)
            {
                ex.ShowUIException();
            }
            catch
            {
                new DBConcurrencyException("Unable to write changes to database. Unexpected error. Please try again.").ShowUIException();
            }
        }