// calculating results for an array of packages private void CalculateResultsPackage(MetaModel model1, MetaModel model2, string[] packagePaths, Results[][] resultsMatrix, int i, int j) { foreach (string packagePath in packagePaths) { Package package1 = model1.FindPackageByPath(packagePath); Package package2 = model2.FindPackageByPath(packagePath); if (package1 == null) { package1 = new Package(); } if (package2 == null) { package2 = new Package(); } package1.ResetCalculation(); package2.ResetCalculation(); resultsMatrix[i][j].NumOfChanges += package2.ComparePackages(package1, relevancy); resultsMatrix[i][j].NumOfChangedElements += package2.NumberOfModifiedElements() + package2.NumberOfAddedElements() + package2.NumberOfRemovedElements(); resultsMatrix[i][j].NumOfModifiedElements += package2.NumberOfModifiedElements(); resultsMatrix[i][j].NumOfAddedElements += package2.NumberOfAddedElements(); resultsMatrix[i][j].NumOfRemovedElements += package2.NumberOfRemovedElements(); resultsMatrix[i][j].NumOfChangedAttributes += package2.NumberOfModifiedAttributes() + package2.NumberOfAddedAttributes() + package2.NumberOfRemovedAttributes(); resultsMatrix[i][j].NumOfModifiedAttributes += package2.NumberOfModifiedAttributes(); resultsMatrix[i][j].NumOfAddedAttributes += package2.NumberOfAddedAttributes(); resultsMatrix[i][j].NumOfRemovedAttributes += package2.NumberOfRemovedAttributes(); resultsMatrix[i][j].NumOfChangedPackages += package2.NumberOfModifiedSubPackages() + package2.NumberOfAddedSubPackages() + package2.NumberOfRemovedSubPackages(); resultsMatrix[i][j].NumOfModifiedPackages += package2.NumberOfModifiedSubPackages(); resultsMatrix[i][j].NumOfAddedPackages += package2.NumberOfAddedSubPackages(); resultsMatrix[i][j].NumOfRemovedPackages += package2.NumberOfRemovedSubPackages(); } }
// calculating results for an array of packages private void CalculateResultsPackage(MetaModel model, string[] packagePaths, Results[] resultsArray, int i) { foreach (string packagePath in packagePaths) { Package package = model.FindPackageByPath(packagePath); if (package == null) { package = new Package(); } resultsArray[i].NumOfElementsMod1 += package.NumberOfElements(relevancy); resultsArray[i].NumOfAttributesMod1 += package.NumberOfAttributes(relevancy); resultsArray[i].NumOfPackagesMod1 += package.NumberOfPackages(relevancy); } }