Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs =================================================================== diff -u -rda6c157314d3df1c278d58cc444c7754a79dc656 -r2ab087c5f7b254eb7ea6d167b122afaea10b0ff6 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision da6c157314d3df1c278d58cc444c7754a79dc656) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision 2ab087c5f7b254eb7ea6d167b122afaea10b0ff6) @@ -28,6 +28,7 @@ using Core.Common.IO.Exceptions; using Core.Common.IO.Readers; using log4net; +using Ringtoets.Common.IO.FileImporters.MessageProviders; using Ringtoets.Piping.Data; using Ringtoets.Piping.IO.Exceptions; using Ringtoets.Piping.IO.Properties; @@ -43,23 +44,31 @@ public class StochasticSoilModelImporter : FileImporterBase { private readonly ILog log = LogManager.GetLogger(typeof(StochasticSoilModelImporter)); + private readonly IImporterMessageProvider messageProvider; private readonly IStochasticSoilModelUpdateModelStrategy modelUpdateStrategy; /// /// Initializes a new instance of the class. /// /// The collection to update. /// The path to the file to import from. + /// The message provider to provide messages during importer actions. /// The to use /// when updating the . /// Thrown when any of the input parameters is null. - public StochasticSoilModelImporter(StochasticSoilModelCollection importTarget, string filePath, IStochasticSoilModelUpdateModelStrategy modelUpdateStrategy) + public StochasticSoilModelImporter(StochasticSoilModelCollection importTarget, string filePath, + IImporterMessageProvider messageProvider, IStochasticSoilModelUpdateModelStrategy modelUpdateStrategy) : base(filePath, importTarget) { if (modelUpdateStrategy == null) { throw new ArgumentNullException(nameof(modelUpdateStrategy)); } + if (messageProvider == null) + { + throw new ArgumentNullException(nameof(messageProvider)); + } + this.messageProvider = messageProvider; this.modelUpdateStrategy = modelUpdateStrategy; } @@ -138,9 +147,10 @@ { var currentStep = 1; StochasticSoilModel[] importedModels = importStochasticSoilModelResult.Items.ToArray(); + string addDataToModelProgressText = messageProvider.GetAddDataToModelProgressText(); foreach (StochasticSoilModel importedModel in importedModels) { - NotifyProgress(RingtoestCommonIOResources.Importer_ProgressText_Adding_imported_data_to_data_model, currentStep, importedModels.Length); + NotifyProgress(addDataToModelProgressText, currentStep, importedModels.Length); if (ValidateStochasticSoilModel(importedModel)) { yield return importedModel;