Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -140,7 +140,13 @@ public void Dispose() { - if (fileReader != null) + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (fileReader != null && disposing) { fileReader.Dispose(); fileReader = null; @@ -178,8 +184,10 @@ { count++; } + lineNumberForMessage++; } + return count; } @@ -270,6 +278,7 @@ } } } + return requiredHeaderColumnIndices; } @@ -319,6 +328,7 @@ break; } } + return readText; } @@ -380,6 +390,7 @@ separator); throw CreateLineParseException(lineNumber, message); } + return readText.Split(separator) .ToArray(); } @@ -418,6 +429,7 @@ parameterName); throw CreateLineParseException(lineNumber, message); } + return parameterTextValue; } @@ -468,6 +480,7 @@ { return double.NaN; } + try { return double.Parse(doubleValueText, CultureInfo.InvariantCulture); @@ -497,17 +510,20 @@ { return VarianceType.NotSpecified; } + try { int typeValue = int.Parse(varianceTypeText, CultureInfo.InvariantCulture); if (typeValue == 0) { return VarianceType.CoefficientOfVariation; } + if (typeValue == 1) { return VarianceType.StandardDeviation; } + throw CreateLineParseException(lineNumber, string.Format(Resources.StructuresCharacteristicsCsvReader_ParseVarianceType_ParameterName_0_only_allows_certain_values, StructureFilesKeywords.VariationTypeColumnName.FirstToUpper()));