Exemplo 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)
        {
            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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes a feature reference to a storage medium if the item is present as part of this collection.
        /// </summary>
        /// <typeparam name="T">The type of feature being referenced (as it is known to the edit
        /// that contains it)</typeparam>
        /// <param name="editSerializer">The mechanism for storing content.</param>
        /// <param name="field">The tag that identifies the item.</param>
        /// <returns>True if a feature reference was written, false if the item with the specific name is not present
        /// in this collection.</returns>
        internal bool WriteFeature <T>(EditSerializer editSerializer, DataField field) where T : Feature
        {
            UpdateItem item;

            if (m_Changes.TryGetValue(field, out item))
            {
                editSerializer.WriteFeatureRef <T>(field, (T)item.Value);
                return(true);
            }

            return(false);
        }
Exemplo n.º 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)
 {
     editSerializer.WriteFeatureRef <LineFeature>(DataField.Base, m_Base);
 }