示例#1
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     SpatialValidatorImplementation.NestedValidator.PipelineCall call = transition;
     if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure)
     {
         validator.Jump(SpatialValidatorImplementation.NestedValidator.PointBuilding);
     }
     else if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         validator.Return();
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
     }
 }
示例#2
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        if (validator.pointCount < 2)
                        {
                            throw new FormatException(Strings.Validator_LineStringNeedsTwoPoints);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.LineStringEnd);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo, SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                }
示例#3
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginLineString:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.LineStringStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PolygonStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPoint:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiPoint);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiLineString:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiLineString);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPolygon:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiPolygon);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginCollection:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.Collection);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFullGlobe:
                        if (validator.depth != 1)
                        {
                            throw new FormatException(Strings.Validator_FullGlobeInCollection);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.FullGlobe);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.Begin, transition);
                }
示例#4
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        if (validator.pointCount != 0)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                        }
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        if (validator.pointCount == 0)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure, transition);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PointEnd);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                }
示例#5
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        validator.ringCount++;
                        if (!validator.processingGeography)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidateGeometryPolygon(validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate);
                            break;
                        }
                        SpatialValidatorImplementation.NestedValidator.ValidateGeographyPolygon(validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate);
                        break;

                    default:
                        SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo, SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                        return;
                    }
                    validator.Jump(SpatialValidatorImplementation.NestedValidator.PolygonStart);
                }