Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresReader.cs =================================================================== diff -u -r2b46bfdee29662c93c0c7280bb8ed1b523d47ebf -r4e578730273a943bb02a2861c694a2707c8ef852 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresReader.cs (.../StructuresReader.cs) (revision 2b46bfdee29662c93c0c7280bb8ed1b523d47ebf) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresReader.cs (.../StructuresReader.cs) (revision 4e578730273a943bb02a2861c694a2707c8ef852) @@ -47,8 +47,8 @@ /// Initializes a new instance of the class. /// /// The shape file path. - /// is invalid. - /// + /// Thrown when is invalid. + /// Thrown when: /// points to a file that does not exist. /// does not only contain point features. /// does not contain all of the required attributes. @@ -69,6 +69,17 @@ } /// + /// Gets the number of structures present in the shapefile. + /// + public int GetStructureCount + { + get + { + return pointsShapeFileReader.GetNumberOfFeatures(); + } + } + + /// /// Retrieve a based on the next point feature in the shapefile. /// /// Thrown when either: @@ -79,7 +90,7 @@ /// A based on the next point feature in the shapefile. public Structure GetNextStructure() { - MapPointData mapPointData = (MapPointData)pointsShapeFileReader.ReadFeature(); + MapPointData mapPointData = (MapPointData) pointsShapeFileReader.ReadFeature(); IDictionary attributes = mapPointData.Features.First().MetaData; @@ -97,6 +108,11 @@ } } + public void Dispose() + { + pointsShapeFileReader.Dispose(); + } + private static string GetIdAttributeValue(IDictionary attributes) { var attributeIdValue = attributes[idAttributeName] as string; @@ -114,22 +130,6 @@ } /// - /// Gets the number of structures present in the shapefile. - /// - public int GetStructureCount - { - get - { - return pointsShapeFileReader.GetNumberOfFeatures(); - } - } - - public void Dispose() - { - pointsShapeFileReader.Dispose(); - } - - /// /// Open a shapefile containing structures as point features. /// /// Shape file path. @@ -149,7 +149,7 @@ } catch (CriticalFileReadException e) { - if (e.InnerException.GetType() == typeof(ApplicationException)) + if (e.InnerException is ApplicationException) { string message = new FileReaderErrorMessageBuilder(shapeFilePath) .Build(Resources.PointShapefileReader_File_can_only_contain_points);