Exemple #1
0
        /// <summary>
        /// Start the background thread and disable all control while it works
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void wizardPage2_ShowFromNext(object sender, EventArgs e)
        {
            this.Cursor         = Cursors.WaitCursor;
            wizard1.NextEnabled = wizard1.BackEnabled = wizard1.CancelEnabled = false;
            pictureBox1.Visible = true;

            lblStatus.Text = Properties.Resources.LabelChecking;
            lblError.Text  = string.Empty;

            UpdateServerDetails();

            ITrac trac = TracCommon.GetTrac(_server);

            IAsyncResult asr = trac.BeginGetAPIVersion();

            while (asr.IsCompleted == false)
            {
                Application.DoEvents();
            }

            try
            {
                object[] ret = trac.EndGetAPIVersion(asr);
                lblStatus.Text = Properties.Resources.LabelCheckingSuccess;
            }
            catch (Exception ex)
            {
                lblStatus.Text = Properties.Resources.LabelCheckingFailure;
                lblError.Text  = ex.Message;
            }

            wizard1.BackEnabled = wizard1.CancelEnabled = true;
            wizard1.NextEnabled = (lblError.Text == string.Empty);

            pictureBox1.Visible = false;
            this.Cursor         = Cursors.Default;
        }