Ejemplo n.º 1
0
        /// <summary>
        /// Writes the content of this instance to a persistent storage area.
        /// </summary>
        /// <param name="editSerializer">The mechanism for storing content.</param>
        public override void WriteData(EditSerializer editSerializer)
        {
            base.WriteData(editSerializer);

            editSerializer.WriteBool(DataField.Topological, IsTopological);

            IPointGeometry tp = Position;
            IPointGeometry pp = GetPolPosition();

            if (pp != null)
            {
                if (pp.Easting.Microns != tp.Easting.Microns || pp.Northing.Microns != tp.Northing.Microns)
                {
                    editSerializer.WriteInt64(DataField.PolygonX, pp.Easting.Microns);
                    editSerializer.WriteInt64(DataField.PolygonY, pp.Northing.Microns);
                }
            }

            // RowText is problematic on deserialization because the database rows might not
            // be there. To cover that possibility, use a proxy object.
            if (m_Geom is RowTextGeometry)
            {
                editSerializer.WritePersistent <TextGeometry>(DataField.Type, new RowTextContent((RowTextGeometry)m_Geom));
            }
            else
            {
                editSerializer.WritePersistent <TextGeometry>(DataField.Type, m_Geom);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes the content of this instance to a persistent storage area.
        /// </summary>
        /// <param name="editSerializer">The mechanism for storing content.</param>
        public override void WriteData(EditSerializer editSerializer)
        {
            editSerializer.WriteBool(DataField.Clockwise, m_IsClockwise);

            // If the circle's first arc has geometry that corresponds to this instance, write
            // out the circle center point. Otherwise refer to the first arc (we'll get the
            // circle geometry from there).

            if (Object.ReferenceEquals(m_Circle.FirstArc.Geometry, this))
            {
                editSerializer.WriteFeatureRef <PointFeature>(DataField.Center, m_Circle.CenterPoint);
            }
            else
            {
                editSerializer.WriteFeatureRef <ArcFeature>(DataField.FirstArc, m_Circle.FirstArc);
            }
        }