コード例 #1
0
 private void checkForNewerVersion()
 {
     if (tryToGetLatestVersionFromServer())
     {
         if (asmVersion.CompareTo(latestVersionNumber) < 0)
         {
             // A newer version is available
             NewVersionFrm nvfrm = new NewVersionFrm(this.asmVersion.ToString(), this.latestVersionNumber.ToString(), url, this.iconImg);
             TriggerAnEvent(NewVersionDetected, nvfrm);
         }
         else
         {
             // The program is up to date!
             if (showResultsIfUpToDate)
             {
                 UpToDateForm utdfrm = new UpToDateForm(this.iconImg);
                 TriggerAnEvent(NewVersionDetected, utdfrm);
             }
         }
     }
     else
     {
         // Unable to find latest verison
         if (showResultsIfUpToDate)
         {
             throw new ApplicationException("Unable to connect to Optec Server. Is your PC connected to the internet?");
         }
     }
 }
コード例 #2
0
 private void checkForNewerVersion()
 {
     if (tryToGetLatestVersionFromServer())
     {
         if (asmVersion.CompareTo(latestVersionNumber) < 0)
         {
             // A newer version is available
             EventLogger.LogMessage("A newer version of this software has been detected.", System.Diagnostics.TraceLevel.Info);
             NewVersionFrm nvfrm = new NewVersionFrm(this.asmVersion.ToString(), this.latestVersionNumber.ToString(), url, this.iconImg);
             TriggerAnEvent(NewVersionDetected, nvfrm);
         }
         else
         {
             EventLogger.LogMessage("The current version of this software is the most recent.", System.Diagnostics.TraceLevel.Info);
             // The program is up to date!
             if (showResultsIfUpToDate)
             {
                 UpToDateForm utdfrm = new UpToDateForm(this.iconImg);
                 TriggerAnEvent(NewVersionDetected, utdfrm);
             }
         }
     }
     else
     {
         // Unable to find latest verison
         if (showResultsIfUpToDate)
         {
             throw new ApplicationException("Unable to connect to Optec Server. Please check your Internet connection and try again. If the problem persists, contact Optec Technical Support.");
         }
     }
 }