Пример #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 virtual void WriteData(EditSerializer editSerializer)
        {
            if (m_Font != null)
            {
                editSerializer.WriteInt32(DataField.Font, m_Font.Id);
            }

            editSerializer.WritePointGeometry(DataField.X, DataField.Y, m_Position);
            editSerializer.WriteDouble(DataField.Width, Math.Round((double)m_Width, 2));
            editSerializer.WriteDouble(DataField.Height, Math.Round((double)m_Height, 2));

            // TODO: May want to cover indirect rotations
            editSerializer.WriteRadians(DataField.Rotation, new RadianValue(m_Rotation.Radians));
        }