Exemplo n.º 1
0
        /// <summary>
        /// Called if the form is closed
        /// </summary>
        /// <param name="sender">The sending object</param>
        /// <param name="e">The event arguments</param>
        private void MainForm_Closing(object sender, CancelEventArgs e)
        {
            //Disconnect/Logout if connected
            if (TdConnection != null)
            {
                if (TdConnection.Connected)
                {
                    TdConnection.Disconnect();
                }

                if (TdConnection.LoggedIn)
                {
                    TdConnection.Logout();
                }
            }
        }
Exemplo n.º 2
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);
        }