예제 #1
0
        internal static bool IsGingerUpgradeNeeded(string solutionFolder, IEnumerable <string> solutionFiles)
        {
            ConcurrentBag <Tuple <eGingerVersionComparisonResult, string> > solutionFilesWithVersion = null;

            //check if Ginger Upgrade is needed for loading this Solution
            try
            {
                //Reporter.ToLog(eLogLevel.INFO, "Checking if Ginger upgrade is needed for loading the Solution");
                if (solutionFilesWithVersion == null)
                {
                    solutionFilesWithVersion = SolutionUpgrade.GetSolutionFilesWithVersion(solutionFiles);
                }
                ConcurrentBag <string> higherVersionFiles = SolutionUpgrade.GetSolutionFilesCreatedWithRequiredGingerVersion(solutionFilesWithVersion, eGingerVersionComparisonResult.HigherVersion);
                if (higherVersionFiles.Count > 0)
                {
                    if (WorkSpace.Instance.RunningInExecutionMode == false && WorkSpace.Instance.RunningFromUnitTest == false)
                    {
                        WorkSpace.Instance.EventHandler.ShowUpgradeGinger(solutionFolder, higherVersionFiles.ToList());
                    }
                    Reporter.ToLog(eLogLevel.WARN, "Ginger upgrade is needed for loading the Solution, aborting Solution load.");
                    return(true);
                }

                return(false);
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Error occurred while checking if Solution requires Ginger Upgrade", ex);
                return(false);
            }
        }
예제 #2
0
 // Offer to upgrade Solution items to current version
 internal static void CheckSolutionItemsUpgrade(string solutionFolder, string solutionName, List <string> solutionFiles)
 {
     try
     {
         if (WorkSpace.Instance.UserProfile.DoNotAskToUpgradeSolutions == false && WorkSpace.Instance.RunningInExecutionMode == false && WorkSpace.Instance.RunningFromUnitTest == false)
         {
             Reporter.ToLog(eLogLevel.INFO, "Checking is Solution Items Upgrade is needed");
             if (solutionFilesWithVersion == null)
             {
                 solutionFilesWithVersion = SolutionUpgrade.GetSolutionFilesWithVersion(solutionFiles);
             }
             ConcurrentBag <string> lowerVersionFiles = SolutionUpgrade.GetSolutionFilesCreatedWithRequiredGingerVersion(solutionFilesWithVersion, eGingerVersionComparisonResult.LowerVersion);
             if (lowerVersionFiles != null && lowerVersionFiles.Count > 0)
             {
                 WorkSpace.Instance.EventHandler.ShowUpgradeSolutionItems(SolutionUpgradePageViewMode.UpgradeSolution, solutionFolder, solutionName, lowerVersionFiles.ToList());
             }
         }
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Error occurred while checking if Solution files should be Upgraded", ex);
     }
 }