Exemple #1
0
 void bwCheck_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled == false)
     {
         if (e.Error == null)
         {
             this.UpgradeFile  = e.Result as UpgradeFile;
             prgProgress.Style = ProgressBarStyle.Continuous;
             if (this.UpgradeFile != null)
             {
                 lblStatus.Text      = Resources.StatusUpgradeIsAvailable;
                 btnUpgrade.Visible  = true;
                 btnDownload.Visible = true;
                 btnUpgrade.Focus();
             }
             else
             {
                 lblStatus.Text         = Resources.StatusUpgradeIsNotAvailable;
                 btnCancel.DialogResult = DialogResult.OK;
                 btnCancel.Text         = Resources.Close;
             }
         }
         else
         {
             MessageBox.ShowDialog(this, Resources.ErrorCannotCheck + "\n\n" + e.Error.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             this.DialogResult = DialogResult.Cancel;
         }
     }
     else
     {
         this.DialogResult = DialogResult.Cancel;
     }
 }
Exemple #2
0
 void bwCheck_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled == false) {
         if (e.Error == null) {
             this.UpgradeFile = e.Result as UpgradeFile;
             prgProgress.Style = ProgressBarStyle.Continuous;
             if (this.UpgradeFile != null) {
                 lblStatus.Text = Resources.StatusUpgradeIsAvailable;
                 btnUpgrade.Visible = true;
                 btnDownload.Visible = true;
                 btnUpgrade.Focus();
             } else {
                 lblStatus.Text = Resources.StatusUpgradeIsNotAvailable;
                 btnCancel.DialogResult = DialogResult.OK;
                 btnCancel.Text = Resources.Close;
             }
         } else {
             MessageBox.ShowDialog(this, Resources.ErrorCannotCheck + "\n\n" + e.Error.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             this.DialogResult = DialogResult.Cancel;
         }
     } else {
         this.DialogResult = DialogResult.Cancel;
     }
 }