Index: Riskeer/Integration/src/Riskeer.Integration.IO/Importers/HydraulicBoundaryDatabaseImporter.cs =================================================================== diff -u -rcd79d36515d32776925c611af08d5251921167c6 -rc67f3aebcce0ce296ef9f6b0ac4eaa82563ce434 --- Riskeer/Integration/src/Riskeer.Integration.IO/Importers/HydraulicBoundaryDatabaseImporter.cs (.../HydraulicBoundaryDatabaseImporter.cs) (revision cd79d36515d32776925c611af08d5251921167c6) +++ Riskeer/Integration/src/Riskeer.Integration.IO/Importers/HydraulicBoundaryDatabaseImporter.cs (.../HydraulicBoundaryDatabaseImporter.cs) (revision c67f3aebcce0ce296ef9f6b0ac4eaa82563ce434) @@ -44,8 +44,9 @@ public class HydraulicBoundaryDatabaseImporter : FileImporterBase { private const int numberOfSteps = 4; - private readonly List changedObservables = new List(); + private readonly IHydraulicBoundaryDataUpdateHandler updateHandler; + private readonly List changedObservables = new List(); /// /// Creates a new instance of . @@ -89,16 +90,17 @@ ReadHydraulicLocationConfigurationDatabase readHydraulicLocationConfigurationDatabase = readHydraulicLocationConfigurationDatabaseResult.Items.Single(); - ReadResult> readExcludedLocationsResult = ReadExcludedLocations(); + ReadResult> readExcludedLocationIdsResult = ReadExcludedLocationIds(); - if (readExcludedLocationsResult.CriticalErrorOccurred || Canceled) + if (readExcludedLocationIdsResult.CriticalErrorOccurred || Canceled) { return false; } - AddHydraulicBoundaryDatabaseToDataModel(readHydraulicBoundaryDatabase, readHydraulicLocationConfigurationDatabase, - readExcludedLocationsResult.Items.Single()); + IEnumerable readExcludedLocationIds = readExcludedLocationIdsResult.Items.Single(); + AddHydraulicBoundaryDatabaseToDataModel(readHydraulicBoundaryDatabase, readHydraulicLocationConfigurationDatabase, readExcludedLocationIds); + return true; } @@ -126,7 +128,7 @@ return true; } - Log.Error(BuildErrorMessage(FilePath, Resources.HydraulicBoundaryDatabaseImporter_Hrd_file_not_in_same_folder_as_hlcd_file)); + Log.Error(BuildErrorMessage(Resources.HydraulicBoundaryDatabaseImporter_Hrd_file_not_in_same_folder_as_hlcd_file)); return false; } @@ -137,7 +139,7 @@ return true; } - Log.Error(BuildErrorMessage(FilePath, Resources.HydraulicBoundaryDatabaseImporter_Hrd_file_already_added)); + Log.Error(BuildErrorMessage(Resources.HydraulicBoundaryDatabaseImporter_Hrd_file_already_added)); return false; } @@ -207,15 +209,15 @@ } } - private ReadResult> ReadExcludedLocations() + private ReadResult> ReadExcludedLocationIds() { NotifyProgress(Resources.HydraulicBoundaryDatabaseImporter_ProgressText_Reading_Hrd_settings_file, 3, numberOfSteps); string hbsdFilePath = HydraulicBoundaryDataHelper.GetHydraulicBoundarySettingsDatabaseFilePath(FilePath); try { using (var reader = new HydraRingSettingsDatabaseReader(hbsdFilePath)) { - return ReadExcludedLocations(reader); + return ReadExcludedLocationIds(reader); } } catch (CriticalFileReadException e) @@ -225,7 +227,7 @@ } } - private ReadResult> ReadExcludedLocations(HydraRingSettingsDatabaseReader reader) + private ReadResult> ReadExcludedLocationIds(HydraRingSettingsDatabaseReader reader) { try { @@ -274,12 +276,7 @@ private string BuildErrorMessage(string message) { - return BuildErrorMessage(FilePath, message); - } - - private static string BuildErrorMessage(string filePath, string message) - { - return new FileReaderErrorMessageBuilder(filePath).Build( + return new FileReaderErrorMessageBuilder(FilePath).Build( string.Format(Resources.HydraulicBoundaryDatabaseImporter_HandleCriticalFileReadError_Error_0_No_HydraulicBoundaryDatabase_imported, message)); }