private void AssertPipelineIsForwardingSegment(SpatialPipeline pipeline)
 {
     Assert.IsNotNull(pipeline.GeographyPipeline, "The GeographyPipeline should not be null");
     Assert.IsNotNull(pipeline.GeometryPipeline, "The GeometryPipeline should not be null");
     Assert.AreEqual(typeof(ForwardingSegment.GeographyForwarder), pipeline.GeographyPipeline.GetType(), "All pipelines that we create must be wrapped in forwarding segments for exception/reset behavior to work");
     Assert.AreEqual(typeof(ForwardingSegment.GeometryForwarder), pipeline.GeometryPipeline.GetType(), "All pipelines that we create must be wrapped in forwarding segments for exception/reset behavior to work");
 }
Beispiel #2
0
 /// <summary> Adds the next pipeline.</summary>
 /// <returns>The last pipesegment in the chain, usually the one just created.</returns>
 /// <param name="destination">The next pipeline.</param>
 public virtual SpatialPipeline ChainTo(SpatialPipeline destination)
 {
     throw new NotImplementedException();
 }
Beispiel #3
0
 /// <summary>
 /// Creates a reader that that will send messages to the destination during read.
 /// </summary>
 /// <param name="destination">The instance to message to during read.</param>
 public GmlReader(SpatialPipeline destination)
     : base(destination)
 {
 }
 /// <summary> Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 /// <param name="geographyPipeline">The geography chain.</param>
 /// <param name="geometryPipeline">The geometry chain.</param>
 public SpatialPipeline(GeographyPipeline geographyPipeline, GeometryPipeline geometryPipeline)
 {
     this.geographyPipeline = geographyPipeline;
     this.geometryPipeline  = geometryPipeline;
     this.startingLink      = this;
 }
 /// <summary> Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 public SpatialPipeline()
 {
     this.startingLink = this;
 }
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(XmlReader readerStream, SpatialPipeline pipeline)
 {
     new GmlReader(pipeline).ReadGeometry(readerStream);
 }
 /// <summary> Reads the Geometry from the readerStream and call the appropriate pipeline methods.</summary>
 /// <param name="readerStream">The stream to read from.</param>
 /// <param name="pipeline">The pipeline to call based on what is read.</param>
 protected abstract void ReadGeometry(TReaderStream readerStream, SpatialPipeline pipeline);
 /// <summary>
 /// Creates a reader that that will send messages to the destination during read.
 /// </summary>
 /// <param name="destination">The instance to message to during read.</param>
 public WellKnownTextSqlReader(SpatialPipeline destination)
     : this(destination, false)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeographyLatLongPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(TextReader readerStream, SpatialPipeline pipeline)
 {
     new WellKnownTextSqlReader(pipeline, allowOnlyTwoDimensions).ReadGeometry(readerStream);
 }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoJsonObjectReader"/> class.
 /// </summary>
 /// <param name="destination">The pipeline.</param>
 internal GeoJsonObjectReader(SpatialPipeline destination)
     : base(destination)
 {
 }
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(XmlReader readerStream, SpatialPipeline pipeline)
 {
     new GmlReader(pipeline).ReadGeometry(readerStream);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="output">The pipeline to redirect the calls to</param>
 public TypeWashedToGeometryPipeline(SpatialPipeline output)
 {
     this.output = output;
 }
Beispiel #14
0
 /// <summary> Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 public SpatialPipeline()
 {
     this.startingLink = this;
 }
Beispiel #15
0
 /// <summary>
 /// Constructs a new SpatialPipeline segment
 /// </summary>
 /// <param name="current">The DrawSpatial to draw to before calling next.</param>
 public ForwardingSegment(SpatialPipeline current)
 {
     Debug.Assert(current.GeographyPipeline == null || !(current.GeographyPipeline is GeographyForwarder), "the current should not already be wrapped.");
     Debug.Assert(current.GeometryPipeline == null || !(current.GeometryPipeline is GeometryForwarder), "the current should not already be wrapped.");
     this.current = current;
 }
Beispiel #16
0
 /// <summary> Initializes a new instance of the <see cref="T:Microsoft.Spatial.SpatialPipeline" /> class. </summary>
 /// <param name="geographyPipeline">The geography chain.</param>
 /// <param name="geometryPipeline">The geometry chain.</param>
 public SpatialPipeline(GeographyPipeline geographyPipeline, GeometryPipeline geometryPipeline)
 {
     this.geographyPipeline = geographyPipeline;
     this.geometryPipeline = geometryPipeline;
     this.startingLink = this;
 }
Beispiel #17
0
        /// <summary>
        /// Creates a reader
        /// </summary>
        /// <param name="destination">the instance of the pipeline that the reader will message while it is reading.</param>
        protected SpatialReader(SpatialPipeline destination)
        {
            Util.CheckArgumentNull(destination, "destination");

            this.Destination = destination;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="WellKnownTextSqlReader"/> class.
 /// </summary>
 /// <param name="destination">The destination.</param>
 /// <param name="allowOnlyTwoDimensions">if set to <c>true</c> allows only two dimensions.</param>
 public WellKnownTextSqlReader(SpatialPipeline destination, bool allowOnlyTwoDimensions)
     : base(destination)
 {
     this.allowOnlyTwoDimensions = allowOnlyTwoDimensions;
 }
 /// <summary> Adds the next pipeline.</summary>
 /// <returns>The last pipesegment in the chain, usually the one just created.</returns>
 /// <param name="destination">The next pipeline.</param>
 public virtual SpatialPipeline ChainTo(SpatialPipeline destination)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Reads the geometry.
 /// </summary>
 /// <param name="readerStream">The reader stream.</param>
 /// <param name="pipeline">The pipeline.</param>
 protected override void ReadGeometry(TextReader readerStream, SpatialPipeline pipeline)
 {
     new WellKnownTextSqlReader(pipeline, allowOnlyTwoDimensions).ReadGeometry(readerStream);
 }
 private static void SendToPipeline(IDictionary<string, object> members, SpatialPipeline pipeline, bool isGeography)
 {
     GeoJsonObjectReader reader = new GeoJsonObjectReader(pipeline);
     if (isGeography)
     {
         reader.ReadGeography(members);
     }
     else
     {
         reader.ReadGeometry(members);
     }
 }