Пример #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.WriteFeatureRef <LineFeature>(DataField.RefLine, m_RefLine);

            if (m_Term1 != null)
            {
                editSerializer.WriteFeatureRef <LineFeature>(DataField.Term1, m_Term1);
            }

            if (m_Term2 != null)
            {
                editSerializer.WriteFeatureRef <LineFeature>(DataField.Term2, m_Term2);
            }

            if (IsArcReversed)
            {
                editSerializer.WriteBool(DataField.ReverseArc, true);
            }

            editSerializer.WritePersistent <Observation>(DataField.Offset, m_Offset);

            if (m_ParLine.StartPoint != OffsetPoint)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.From, new FeatureStub(m_ParLine.StartPoint));
            }

            if (m_ParLine.EndPoint != OffsetPoint)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_ParLine.EndPoint));
            }

            editSerializer.WritePersistent <FeatureStub>(DataField.NewLine, new FeatureStub(m_ParLine));
        }
        /// <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.WriteFeatureRef <LineFeature>(DataField.Line, m_Line);
            editSerializer.WritePersistent <Distance>(DataField.Distance, m_Distance);
            editSerializer.WriteBool(DataField.EntryFromEnd, m_IsFromEnd);
            editSerializer.WritePersistent <FeatureStub>(DataField.NewPoint, new FeatureStub(m_NewPoint));
            editSerializer.WriteInternalId(DataField.NewLine1, m_NewLine1.InternalId);
            editSerializer.WriteInternalId(DataField.NewLine2, m_NewLine2.InternalId);
        }
Пример #3
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.WritePersistent <Direction>(DataField.Direction, m_Direction);
            editSerializer.WritePersistent <Observation>(DataField.Length, m_Length);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.Line, new FeatureStub(m_Line));
            }
        }
Пример #4
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.WriteFeatureRef <LineFeature>(DataField.Line, m_ExtendLine);
            editSerializer.WriteBool(DataField.ExtendFromEnd, m_IsExtendFromEnd);
            editSerializer.WritePersistent <Distance>(DataField.Distance, m_Length);
            editSerializer.WritePersistent <FeatureStub>(DataField.NewPoint, new FeatureStub(m_NewPoint));

            if (m_NewLine != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.NewLine, new FeatureStub(m_NewLine));
            }
        }
Пример #5
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.WriteFeatureRef <LineFeature>(DataField.Line1, m_Line1);
            editSerializer.WriteFeatureRef <LineFeature>(DataField.Line2, m_Line2);
            editSerializer.WriteFeatureRef <PointFeature>(DataField.CloseTo, m_CloseTo);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_Intersection));

            if (m_Line1a != null)
            {
                editSerializer.WriteInternalId(DataField.SplitBefore1, m_Line1a.InternalId);
            }

            if (m_Line1b != null)
            {
                editSerializer.WriteInternalId(DataField.SplitAfter1, m_Line1b.InternalId);
            }

            if (m_Line2a != null)
            {
                editSerializer.WriteInternalId(DataField.SplitBefore2, m_Line2a.InternalId);
            }

            if (m_Line2b != null)
            {
                editSerializer.WriteInternalId(DataField.SplitAfter2, m_Line2b.InternalId);
            }
        }
Пример #6
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)
 {
     if (m_Offset != null)
     {
         editSerializer.WritePersistent <Offset>(DataField.Offset, m_Offset);
     }
 }
Пример #7
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.WriteFeatureRef <LineFeature>(DataField.Line, m_Line);
            editSerializer.WriteUInt32(DataField.PositionRatio, m_PositionRatio);
            editSerializer.WritePersistent <FeatureStub>(DataField.Point, new FeatureStub(m_Point));
        }
Пример #8
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.WritePersistent <Direction>(DataField.Direction1, m_Direction1);
            editSerializer.WritePersistent <Direction>(DataField.Direction2, m_Direction2);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line1 != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.Line1, new FeatureStub(m_Line1));
            }

            if (m_Line2 != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.Line2, new FeatureStub(m_Line2));
            }
        }
Пример #9
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);

            // Bit of a hack - does NewCircleOperation actually need to extend NewLineOperation?
            if (!(this is NewCircleOperation))
            {
                editSerializer.WritePersistent <LineFeature>(DataField.Line, m_NewLine);
            }
        }
        /// <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.WritePersistent <Direction>(DataField.Direction, m_Direction);
            editSerializer.WritePersistent <Observation>(DataField.Distance, m_Distance);
            editSerializer.WriteFeatureRef <PointFeature>(DataField.From, m_From);
            editSerializer.WriteBool(DataField.Default, m_Default);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_DirLine != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.DirLine, new FeatureStub(m_DirLine));
            }

            if (m_DistLine != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.DistLine, new FeatureStub(m_DistLine));
            }
        }
Пример #11
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.WritePersistent <Observation>(DataField.Distance1, m_Distance1);
            editSerializer.WriteFeatureRef <PointFeature>(DataField.From1, m_From1);
            editSerializer.WritePersistent <Observation>(DataField.Distance2, m_Distance2);
            editSerializer.WriteFeatureRef <PointFeature>(DataField.From2, m_From2);
            editSerializer.WriteBool(DataField.Default, m_Default);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line1 != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.Line1, new FeatureStub(m_Line1));
            }

            if (m_Line2 != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.Line2, new FeatureStub(m_Line2));
            }
        }
        /// <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.WritePersistent <Direction>(DataField.Direction, m_Direction);
            editSerializer.WriteFeatureRef <LineFeature>(DataField.Line, m_Line);
            editSerializer.WriteFeatureRef <PointFeature>(DataField.CloseTo, m_CloseTo);
            editSerializer.WritePersistent <FeatureStub>(DataField.To, new FeatureStub(m_Intersection));

            if (m_DirLine != null)
            {
                editSerializer.WritePersistent <FeatureStub>(DataField.DirLine, new FeatureStub(m_DirLine));
            }

            if (m_LineA != null)
            {
                editSerializer.WriteInternalId(DataField.SplitBefore, m_LineA.InternalId);
            }

            if (m_LineB != null)
            {
                editSerializer.WriteInternalId(DataField.SplitAfter, m_LineB.InternalId);
            }
        }
Пример #13
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.WriteFeatureRef <PointFeature>(DataField.Center, m_Center);
            editSerializer.WritePersistent <Observation>(DataField.Radius, m_Radius);

            // Record a closing point only if it was created by this edit -- in that case, the radius must
            // be a plain Distance (if the radius is defined using an OffsetPoint observation, the closing
            // point will coincide with the offset point itself -- we don't have to write anything further,
            // because the reference to the offset point is part of the observation object written above).

            if (Line.StartPoint.Creator == this)
            {
                Debug.Assert(m_Radius is Distance);
                editSerializer.WritePersistent <FeatureStub>(DataField.ClosingPoint, new FeatureStub(Line.StartPoint));
            }
            else
            {
                Debug.Assert(m_Radius is OffsetPoint);
            }

            editSerializer.WritePersistent <FeatureStub>(DataField.Arc, new FeatureStub(Line));
        }
Пример #14
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.WriteFeatureRef <LineFeature>(DataField.Line, m_Line);
            editSerializer.WritePersistent <LineSubdivisionFace>(DataField.Face, m_Face);

            // When we initially write the primary face, this will always be undefined. Only the
            // alternate face will write out the reference to the other side.
            if (OtherSide != null)
            {
                editSerializer.WriteInternalId(DataField.OtherSide, OtherSide.InternalId);
            }

            editSerializer.WriteEntity(DataField.PointType, EditingController.Current.Project.DefaultPointType);
            editSerializer.WriteIdMappings(DataField.Ids, this.Features);
        }
Пример #15
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.WriteFeatureRef<PointFeature>(DataField.From, m_From);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.To, m_To);
            editSerializer.WriteBool(DataField.Topological, IsTopological);

            // For simple line segments (perhaps 80% of the case when dealing with cadastral
            // data), we already have what we need with the from & to points.
            if (!(m_Geom is SegmentGeometry))
                editSerializer.WritePersistent<LineGeometry>(DataField.Type, m_Geom);
        }
        /// <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.WritePersistent<Direction>(DataField.Direction, m_Direction);
            editSerializer.WritePersistent<Observation>(DataField.Distance, m_Distance);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.From, m_From);
            editSerializer.WriteBool(DataField.Default, m_Default);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_DirLine != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.DirLine, new FeatureStub(m_DirLine));

            if (m_DistLine != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.DistLine, new FeatureStub(m_DistLine));
        }
        /// <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.WritePersistent<Direction>(DataField.Direction, m_Direction);
            editSerializer.WriteFeatureRef<LineFeature>(DataField.Line, m_Line);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.CloseTo, m_CloseTo);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_Intersection));

            if (m_DirLine != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.DirLine, new FeatureStub(m_DirLine));

            if (m_LineA != null)
                editSerializer.WriteInternalId(DataField.SplitBefore, m_LineA.InternalId);

            if (m_LineB != null)
                editSerializer.WriteInternalId(DataField.SplitAfter, m_LineB.InternalId);
        }
        /// <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.WriteFeatureRef<LineFeature>(DataField.Line, m_Line);
            editSerializer.WritePersistent<Distance>(DataField.Distance, m_Distance);
            editSerializer.WriteBool(DataField.EntryFromEnd, m_IsFromEnd);
            editSerializer.WritePersistent<FeatureStub>(DataField.NewPoint, new FeatureStub(m_NewPoint));
            editSerializer.WriteInternalId(DataField.NewLine1, m_NewLine1.InternalId);
            editSerializer.WriteInternalId(DataField.NewLine2, m_NewLine2.InternalId);
        }
        /// <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.WriteFeatureRef<LineFeature>(DataField.Line, m_Line);
            editSerializer.WriteUInt32(DataField.PositionRatio, m_PositionRatio);
            editSerializer.WritePersistent<FeatureStub>(DataField.Point, new FeatureStub(m_Point));
        }
Пример #20
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)
 {
     if (m_Offset != null)
         editSerializer.WritePersistent<Offset>(DataField.Offset, m_Offset);
 }
        /// <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.WritePersistent<Observation>(DataField.Distance1, m_Distance1);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.From1, m_From1);
            editSerializer.WritePersistent<Observation>(DataField.Distance2, m_Distance2);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.From2, m_From2);
            editSerializer.WriteBool(DataField.Default, m_Default);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line1 != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.Line1, new FeatureStub(m_Line1));

            if (m_Line2 != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.Line2, new FeatureStub(m_Line2));
        }
        /// <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.WriteFeatureRef<LineFeature>(DataField.Line, m_Line);
            editSerializer.WritePersistent<LineSubdivisionFace>(DataField.Face, m_Face);

            // When we initially write the primary face, this will always be undefined. Only the
            // alternate face will write out the reference to the other side.
            if (OtherSide != null)
                editSerializer.WriteInternalId(DataField.OtherSide, OtherSide.InternalId);

            editSerializer.WriteEntity(DataField.PointType, EditingController.Current.Project.DefaultPointType);
            editSerializer.WriteIdMappings(DataField.Ids, this.Features);
        }
Пример #23
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.WritePersistent <Distance>(DataField.Offset, m_Offset);
     editSerializer.WriteBool(DataField.Left, m_IsLeft);
 }
Пример #24
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.WritePersistent<Distance>(DataField.Offset, m_Offset);
     editSerializer.WriteBool(DataField.Left, m_IsLeft);
 }
Пример #25
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.WritePersistent<Direction>(DataField.Direction, m_Direction);
            editSerializer.WritePersistent<Observation>(DataField.Length, m_Length);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.Line, new FeatureStub(m_Line));
        }
Пример #26
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);

            // Bit of a hack - does NewCircleOperation actually need to extend NewLineOperation?
            if (!(this is NewCircleOperation))
                editSerializer.WritePersistent<LineFeature>(DataField.Line, m_NewLine);
        }
Пример #27
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.WritePersistent<PointFeature>(DataField.Point, m_NewPoint);
 }
Пример #28
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);
        }
Пример #29
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.WritePersistent <PointFeature>(DataField.Point, m_NewPoint);
 }
        /// <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.WriteFeatureRef<LineFeature>(DataField.Line1, m_Line1);
            editSerializer.WriteFeatureRef<LineFeature>(DataField.Line2, m_Line2);
            editSerializer.WriteFeatureRef<PointFeature>(DataField.CloseTo, m_CloseTo);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_Intersection));

            if (m_Line1a != null)
                editSerializer.WriteInternalId(DataField.SplitBefore1, m_Line1a.InternalId);

            if (m_Line1b != null)
                editSerializer.WriteInternalId(DataField.SplitAfter1, m_Line1b.InternalId);

            if (m_Line2a != null)
                editSerializer.WriteInternalId(DataField.SplitBefore2, m_Line2a.InternalId);

            if (m_Line2b != null)
                editSerializer.WriteInternalId(DataField.SplitAfter2, m_Line2b.InternalId);
        }
Пример #31
0
 /// <summary>
 /// Represents this editing operation as a text string.
 /// </summary>
 /// <returns>A string that can be used to save a persistent version of this edit.</returns>
 internal string GetEditString()
 {
     EditSerializer es = new EditSerializer();
     es.WritePersistent<Operation>(DataField.Edit, this);
     return es.ToSerializedString();
 }
        /// <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.WritePersistent<Direction>(DataField.Direction1, m_Direction1);
            editSerializer.WritePersistent<Direction>(DataField.Direction2, m_Direction2);
            editSerializer.WritePersistent<FeatureStub>(DataField.To, new FeatureStub(m_To));

            if (m_Line1 != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.Line1, new FeatureStub(m_Line1));

            if (m_Line2 != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.Line2, new FeatureStub(m_Line2));
        }
Пример #33
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.WriteFeatureRef<PointFeature>(DataField.Center, m_Center);
            editSerializer.WritePersistent<Observation>(DataField.Radius, m_Radius);

            // Record a closing point only if it was created by this edit -- in that case, the radius must
            // be a plain Distance (if the radius is defined using an OffsetPoint observation, the closing
            // point will coincide with the offset point itself -- we don't have to write anything further,
            // because the reference to the offset point is part of the observation object written above).

            if (Line.StartPoint.Creator == this)
            {
                Debug.Assert(m_Radius is Distance);
                editSerializer.WritePersistent<FeatureStub>(DataField.ClosingPoint, new FeatureStub(Line.StartPoint));
            }
            else
            {
                Debug.Assert(m_Radius is OffsetPoint);
            }

            editSerializer.WritePersistent<FeatureStub>(DataField.Arc, new FeatureStub(Line));
        }
        /// <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.WriteFeatureRef<LineFeature>(DataField.Line, m_ExtendLine);
            editSerializer.WriteBool(DataField.ExtendFromEnd, m_IsExtendFromEnd);
            editSerializer.WritePersistent<Distance>(DataField.Distance, m_Length);
            editSerializer.WritePersistent<FeatureStub>(DataField.NewPoint, new FeatureStub(m_NewPoint));

            if (m_NewLine != null)
                editSerializer.WritePersistent<FeatureStub>(DataField.NewLine, new FeatureStub(m_NewLine));
        }