예제 #1
0
 /// <summary>
 /// What to do if a new update is found.
 /// </summary>
 void IUpdateCheckListener.OnFoundNewerVersion()
 {
     try
     {
         // Pure and simple:  Tell the updater to get the new version:
         if (updateChecker != null)
         {
             updateChecker.GetNewerVersion();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("I was unable to download the latest update.  Please try again later.", "Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
예제 #2
0
 public void OnFoundNewerVersion()
 {
     // This is pretty simple.  If the update check found a new version, tell it to
     // go ahead and download it.  Note that the update checker will handle any user
     // notifications, which includes a prompt on whether or not they'd like to
     // upgrade.  The null check is probably redudant--this method should never be
     // called if the update checker is null--but it's a belt-and-suspenders thing.
     try
     {
         if (updateChecker != null)
         {
             if (parent.IsMono)
             {
                 updateChecker.NotifyUserOfNewVersionOnly(Properties.Resources.UpdateAltDownloadPage);
             }
             else
             {
                 updateChecker.GetNewerVersion();
             }
         }
     }
     // If anything blows up, make sure to re-enable the button to let the user
     // try again:
     catch (Exception ex)
     {
         if (debug)
         {
             MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         }
         else
         {
             MessageBox.Show("An error occurred while attempting to download the new version. " +
                             "Please try downloading it again later.", "Error", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         }
         ResetUpdateCheckButton(btnCheckForUpdatesText);
     }
 }