Exemplo n.º 1
0
        private void SbStart_Click(object sender, EventArgs e)
        {
            if (!NetConfiguration.PingTest())
            {
                XtraMessageBox.Show("Please connect to internet.");
                SbStart.Focus();
                return;
            }

            if (string.IsNullOrEmpty(TeURL.Text))
            {
                XtraMessageBox.Show("Please enter URL.");
                TeURL.Focus();
                return;
            }

            SbStart.Enabled = false;
            if (BwStart.IsBusy)
            {
                BwStart.CancelAsync();
            }
            else
            {
                BwStart.RunWorkerAsync();
            }
            PgrsPanel.Show();
        }
Exemplo n.º 2
0
        private void BwStart_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                BwStart.RunWorkerAsync();
                return;
            }

            if (e.Error != null)
            {
                PgrsPanel.Hide();
                SbStart.Enabled = true;
                XtraMessageBox.Show(e.Error.Message);
                return;
            }

            if ((bool)e.Result)
            {
                PgrsPanel.Hide();
                SbStart.Enabled = true;
                XtraMessageBox.Show("Automation completed.");
            }
        }