示例#1
0
        /// <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);
        }
示例#2
0
        /// <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);
            }
        }