Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs =================================================================== diff -u -re6fc9977574d3546472607de8f41060a11c81120 -r8032f92c2e70b9de9c14badf771dbb5f6a2273e7 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision e6fc9977574d3546472607de8f41060a11c81120) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 8032f92c2e70b9de9c14badf771dbb5f6a2273e7) @@ -95,10 +95,10 @@ public bool Export() { - return Export(calculationGroup, folderPath); + return ExportCalculationItemsRecursively(calculationGroup, folderPath); } - private bool Export(CalculationGroup groupToExport, string nestedFolderPath) + private bool ExportCalculationItemsRecursively(CalculationGroup groupToExport, string nestedFolderPath) { CreateDirectory(nestedFolderPath); @@ -115,7 +115,14 @@ if (calculationItem is MacroStabilityInwardsCalculation calculation) { - continueExport = ExportCalculation(calculation, nestedFolderPath, exportedCalculations); + if (!calculation.HasOutput) + { + log.WarnFormat(Resources.MacroStabilityInwardsCalculationGroupExporter_Export_Calculation_0_has_no_output_and_is_skipped, calculation.Name); + } + else + { + continueExport = ExportCalculation(calculation, nestedFolderPath, exportedCalculations); + } } if (!continueExport) @@ -139,7 +146,7 @@ { string uniqueGroupName = NamingHelper.GetUniqueName(exportedGroups, nestedGroup.Name, group => group.Name); - bool exportSucceeded = Export(nestedGroup, Path.Combine(nestedFolderPath, uniqueGroupName)); + bool exportSucceeded = ExportCalculationItemsRecursively(nestedGroup, Path.Combine(nestedFolderPath, uniqueGroupName)); if (!exportSucceeded) { return false; @@ -152,20 +159,13 @@ private bool ExportCalculation(MacroStabilityInwardsCalculation calculation, string nestedFolderPath, ICollection exportedCalculations) { - if (!calculation.HasOutput) + bool exportSucceeded = Export(calculation, nestedFolderPath, exportedCalculations); + if (!exportSucceeded) { - log.WarnFormat(Resources.MacroStabilityInwardsCalculationGroupExporter_Export_Calculation_0_has_no_output_and_is_skipped, calculation.Name); + return false; } - else - { - bool exportSucceeded = Export(calculation, nestedFolderPath, exportedCalculations); - if (!exportSucceeded) - { - return false; - } - exportedCalculations.Add(calculation); - } + exportedCalculations.Add(calculation); return true; }