Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs =================================================================== diff -u -r78382ec129ddc7537096860680cef36f3796700d -rbcad3e9362f5130ab5f29dad05ec17a6812d859a --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 78382ec129ddc7537096860680cef36f3796700d) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision bcad3e9362f5130ab5f29dad05ec17a6812d859a) @@ -40,6 +40,7 @@ using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.Forms.TreeNodeInfos; using Ringtoets.Common.IO.FileImporters.MessageProviders; +using Ringtoets.Common.IO.SoilProfile; using Ringtoets.Common.IO.SurfaceLines; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -48,7 +49,6 @@ using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; using Ringtoets.MacroStabilityInwards.Forms.Views; using Ringtoets.MacroStabilityInwards.IO.Configurations; -using Ringtoets.MacroStabilityInwards.IO.Importers; using Ringtoets.MacroStabilityInwards.Plugin.FileImporter; using Ringtoets.MacroStabilityInwards.Plugin.Properties; using Ringtoets.MacroStabilityInwards.Primitives; @@ -112,7 +112,12 @@ Image = MacroStabilityInwardsFormsResources.SoilProfileIcon, FileFilterGenerator = StochasticSoilModelFileFilter, IsEnabled = context => context.AssessmentSection.ReferenceLine != null, - CreateFileImporter = (context, filePath) => StochasticSoilModelImporter(context, filePath, new ImportMessageProvider(), new StochasticSoilModelReplaceDataStrategy(context.FailureMechanism)), + CreateFileImporter = (context, filePath) => new StochasticSoilModelImporter( + context.WrappedData, + filePath, + new ImportMessageProvider(), + MacroStabilityInwardsStochasticSoilModelImporterConfigurationFactory.CreateReplaceStrategyConfiguration(context.FailureMechanism) + ), VerifyUpdates = context => VerifyStochasticSoilModelUpdates(context, Resources.MacroStabilityInwardsPlugin_VerifyStochasticSoilModelImport_When_importing_StochasticSoilModels_calculation_output_will_be_cleared_confirm) }; @@ -164,7 +169,12 @@ FileFilterGenerator = StochasticSoilModelFileFilter, IsEnabled = context => context.WrappedData.SourcePath != null, CurrentPath = context => context.WrappedData.SourcePath, - CreateFileImporter = (context, filePath) => StochasticSoilModelImporter(context, filePath, new UpdateMessageProvider(), new StochasticSoilModelUpdateDataStrategy(context.FailureMechanism)), + CreateFileImporter = (context, filePath) => new StochasticSoilModelImporter( + context.WrappedData, + filePath, + new UpdateMessageProvider(), + MacroStabilityInwardsStochasticSoilModelImporterConfigurationFactory.CreateUpdateStrategyConfiguration(context.FailureMechanism) + ), VerifyUpdates = context => VerifyStochasticSoilModelUpdates( context, @@ -354,15 +364,6 @@ } } - private static StochasticSoilModelImporter StochasticSoilModelImporter(StochasticSoilModelCollectionContext context, string filePath, - IImporterMessageProvider messageProvider, IStochasticSoilModelUpdateModelStrategy updateStrategy) - { - return new StochasticSoilModelImporter(context.WrappedData, - filePath, - messageProvider, - updateStrategy); - } - private bool VerifyStochasticSoilModelUpdates(StochasticSoilModelCollectionContext context, string query) { var changeHandler = new FailureMechanismCalculationChangeHandler(context.FailureMechanism,