示例#1
0
        private void CleanAndMergeSourceSolutions(List <Solution> affectedSuperSolutions, Dictionary <string, string> mappings)
        {
            foreach (var item in affectedSuperSolutions)
            {
                UpdateDialogMessage($"Cleaning source solution {item.UniqueName}...");
                CurrentSolutionManager.CleanSolution(item.Id);
                UpdateDialogMessage($"Merging new result in source solution {item.UniqueName}...");

                var sourceKey = item.UniqueName;
                var backupKey = mappings[sourceKey];

                var backupSolution             = CurrentSolutionManager.GetSolution(backupKey);
                var componentsInBackupSolution = CurrentSolutionManager.GetSolutionComponents(backupSolution.Id, false);
                UpdateDialogMessage($"Calculating new components for {item.UniqueName}...");
                var componentsForThisSolution = GetSolutionComponentsForSolution(item).Cast <SolutionComponentBase>().ToList();
                var allComponents             = new List <SolutionComponentBase>();
                allComponents.AddRange(componentsInBackupSolution);
                allComponents.AddRange(componentsForThisSolution);

                var newSuperSolutionComponents =
                    CurrentSolutionManager
                    .GetMergedSolutionComponents(allComponents);
                UpdateDialogMessage($"Adding components to supersolution {item.UniqueName}...");
                CurrentSolutionManager.CreateMergedSolution(item.Id, newSuperSolutionComponents);
                UpdateDialogMessage($"Increasing revision version of {item.UniqueName}...");
                CurrentSolutionManager.IncreaseSolutionRevisionVersion(item.Id);
                item.Version = CurrentSolutionManager.GetSolutionVersion(item.Id);
            }
        }