Esempio n. 1
0
 internal abstract void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator);
Esempio n. 2
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.PolygonBuilding);
     }
     else if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         validator.ringCount = 0;
         validator.Return();
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
     }
 }
Esempio n. 3
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition == SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem)
     {
         validator.Call(SpatialValidatorImplementation.NestedValidator.BeginSpatial);
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, transition);
     }
 }
Esempio n. 4
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         validator.Return();
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
     }
 }
Esempio n. 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);
                }
Esempio n. 6
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     SpatialValidatorImplementation.NestedValidator.PipelineCall call = transition;
     if (call != SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem)
     {
         if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon)
         {
             validator.Call(SpatialValidatorImplementation.NestedValidator.PolygonStart);
         }
         else if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
         {
             validator.Return();
         }
         else
         {
             SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
         }
     }
 }
Esempio n. 7
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);
                }
Esempio n. 8
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.End:
                        validator.Return();
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
                }
Esempio n. 9
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);
                }
Esempio n. 10
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition != SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         throw new FormatException(Strings.Validator_FullGlobeCannotHaveElements);
     }
     validator.Return();
 }
Esempio n. 11
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

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

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

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

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

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

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

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFullGlobe:
                        throw new FormatException(Strings.Validator_FullGlobeInCollection);

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.End:
                        validator.Return();
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.Begin, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
                }
Esempio n. 12
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);
                }