private int CheckPolygonPoints( [NotNull] IEnumerable <PolygonPoints> polygonPointsToCheck) { Assert.ArgumentNotNull(polygonPointsToCheck, nameof(polygonPointsToCheck)); Dictionary <int, List <PolygonPointsError> > errorsByTable = GetErrorsByTable(polygonPointsToCheck); int errorCount = 0; foreach (KeyValuePair <int, List <PolygonPointsError> > pair in errorsByTable) { int tableIndex = pair.Key; List <PolygonPointsError> errors = pair.Value; var featureClass = (IFeatureClass)InvolvedTables[tableIndex]; Dictionary <int, PolygonPointsError> errorsByOid = GetErrorsByOid(errors); const bool recycle = true; foreach ( IFeature polygonFeature in GdbQueryUtils.GetFeatures(featureClass, errorsByOid.Keys, recycle)) { IGeometry errorGeometry = polygonFeature.ShapeCopy; PolygonPointsError error = errorsByOid[polygonFeature.OID]; errorCount += ReportError(error.ErrorDescription, errorGeometry, error.IssueCode, null, GetInvolvedRows(polygonFeature, error)); } } return(errorCount); }
private IEnumerable <InvolvedRow> GetInvolvedRows( [NotNull] IFeature polygonFeature, [NotNull] PolygonPointsError error) { yield return(new InvolvedRow(polygonFeature)); foreach (PointFeature pointFeature in error.PointFeatures) { ITable pointFeatureClass = InvolvedTables[pointFeature.TableIndex]; yield return(new InvolvedRow( DatasetUtils.GetName(pointFeatureClass), pointFeature.OID)); } }