/// <summary> /// Tries to reconnect QC if we get an error condition /// </summary> public void TryReconnect() { try { TdConnection.Disconnect(); } catch (Exception) { //Fail quietly } string domainName = (string)this.cboDomain.SelectedValue; string projectName = (string)this.cboProject.SelectedValue; TdConnection.InitConnectionEx(this.txtServer.Text); TdConnection.Login(this.txtLogin.Text, this.txtPassword.Text); TdConnection.Connect(domainName, projectName); }
/// <summary> ///Makes sure that we remain connected to QC during import /// </summary> public void EnsureConnected() { //If not connected, then try to reconnect if (!this.TdConnection.Connected) { string domainName = (string)this.cboDomain.SelectedValue; string projectName = (string)this.cboProject.SelectedValue; TdConnection.InitConnectionEx(this.txtServer.Text); TdConnection.Login(this.txtLogin.Text, this.txtPassword.Text); TdConnection.Connect(domainName, projectName); } //Make sure project is connected if (!this.TdConnection.ProjectConnected) { string domainName = (string)this.cboDomain.SelectedValue; string projectName = (string)this.cboProject.SelectedValue; TdConnection.Connect(domainName, projectName); } }