Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs
===================================================================
diff -u -r08bb42496e8a53fadae26340ea3d51939c846679 -ra38844bb9c025b36f4639d7c6432eb3c7d1ee1c6
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision 08bb42496e8a53fadae26340ea3d51939c846679)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision a38844bb9c025b36f4639d7c6432eb3c7d1ee1c6)
@@ -79,8 +79,7 @@
{
get
{
- return string.Format(RingtoetsCommonIOResources.DikeProfilesImport_FileFilter_0_1_shapefile_extension,
- Resources.DikeProfilesImporter_DisplayName, RingtoetsCommonDataResources.DikeProfilesImporter_FileFilter_Shapefile);
+ return string.Format("{0} shape bestand (*.shp)|*.shp", Name);
}
}
@@ -190,9 +189,9 @@
///
/// Get the next DikeProfileLocation from and add to in case it is close enough to .
///
- /// Reader reading DikeProfileLocations for a shapefile.
+ /// Reader reading s for a shapefile.
/// The reference line.
- /// Collection of DikeProfileLocations to which a new DikeProfileLocation is to be added.
+ /// Collection of s to which a new is to be added.
///
/// - The shapefile misses a value for a required attribute.
/// - The shapefile has an attribute whose type is incorrect.
@@ -203,7 +202,7 @@
double distanceToReferenceLine = GetDistanceToReferenceLine(dikeProfileLocation.Point, referenceLine);
if (distanceToReferenceLine > 1.0)
{
- log.Error(string.Format(Resources.DikeProfilesImporter_AddNextDikeProfileLocation_0_skipping_location_outside_referenceline, dikeProfileLocation.Id));
+ log.ErrorFormat(Resources.DikeProfilesImporter_AddNextDikeProfileLocation_0_skipping_location_outside_referenceline, dikeProfileLocation.Id);
return;
}
dikeProfileLocations.Add(dikeProfileLocation);
@@ -251,7 +250,7 @@
dikeProfileData.Add(data);
}
}
- // No need to catch ArgumentException, as prflFilePaths are valid by construction.
+ // No need to catch ArgumentException, as prflFilePaths are valid by construction.
catch (CriticalFileReadException exception)
{
log.Error(exception.Message);
@@ -286,7 +285,7 @@
foreach (string filePath in keyValuePair.Value)
{
- if (BuilderNotAtMaxCapacity(builder, filePath))
+ if (BuilderHasCapacityForFilePath(builder, filePath))
{
builder.AppendLine(filePath);
}
@@ -296,7 +295,7 @@
}
}
- private static bool BuilderNotAtMaxCapacity(StringBuilder builder, string filePath)
+ private static bool BuilderHasCapacityForFilePath(StringBuilder builder, string filePath)
{
return builder.Length + filePath.Length + Environment.NewLine.Length < builder.MaxCapacity;
}
@@ -322,10 +321,9 @@
return dikeProfiles;
}
- private DikeProfileData GetMatchingDikeProfileData(ICollection dikeProfileDataCollection, string id)
+ private static DikeProfileData GetMatchingDikeProfileData(ICollection dikeProfileDataCollection, string id)
{
- DikeProfileData matchingDikeProfileData = dikeProfileDataCollection.FirstOrDefault(d => d.Id.Equals(id));
- return matchingDikeProfileData;
+ return dikeProfileDataCollection.FirstOrDefault(d => d.Id.Equals(id));
}
private static DikeProfile CreateDikeProfile(DikeProfileLocation dikeProfileLocation, DikeProfileData dikeProfileData)