コード例 #1
0
ファイル: MainForm.cs プロジェクト: wittrup/flysight
 private void mWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     lock (mOnlineVersionLock)
     {
         Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
         if (mOnlineVersion > currentVersion)
         {
             if (MessageBox.Show(this, "A new version is available online, do you wish to download it?",
                                 "New version available", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
             {
                 DownloadDialog dlg         = new DownloadDialog();
                 string         installPath = dlg.DownloadInstaller(this, mOnlineVersion);
                 if (!string.IsNullOrEmpty(installPath))
                 {
                     Process.Start(installPath);
                     Close();
                 }
             }
         }
         else if ((bool)e.Result)
         {
             MessageBox.Show(this, "You are running the latest version.", "Perfect");
         }
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: tvandijck/flysight
 private void mWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     lock (mOnlineVersionLock)
     {
         Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
         if (mOnlineVersion > currentVersion)
         {
             if (MessageBox.Show(this, "A new version is available online, do you wish to download it?",
                 "New version available", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
             {
                 DownloadDialog dlg = new DownloadDialog();
                 string installPath = dlg.DownloadInstaller(this, mOnlineVersion);
                 if (!string.IsNullOrEmpty(installPath))
                 {
                     Process.Start(installPath);
                     Close();
                 }
             }
         }
         else if ((bool)e.Result)
         {
             MessageBox.Show(this, "You are running the latest version.", "Perfect");
         }
     }
 }