Пример #1
0
        /// <summary>
        /// Executes the move operation.
        /// </summary>
        /// <param name="to">The position to move to</param>
        internal void Execute(PointGeometry to)
        {
            // Remember the old and new positions.
            m_OldPosition = PointGeometry.Create(m_Text.Position);

            // Remember old polygon reference position if it's different from the text position
            m_OldPolPosition = PointGeometry.Create(m_Text.GetPolPosition());
            if (m_OldPosition.IsCoincident(m_OldPolPosition))
            {
                m_OldPolPosition = null;
            }

            m_NewPosition = to;

            // Move the text and ensure any enclosing polygon has been reworked
            m_Text.Move(to);
            m_Text.RecalculateEnclosingPolygon();

            // Peform standard completion steps
            Complete();
        }
Пример #2
0
        /// <summary>
        /// Executes the move operation.
        /// </summary>
        /// <param name="to">The revised position of the reference point.</param>
        internal void Execute(PointGeometry to)
        {
            // Remember the old and new positions.
            IPointGeometry txtPos = m_Label.Position;
            IPointGeometry polPos = m_Label.GetPolPosition();

            if (txtPos.IsCoincident(polPos))
            {
                m_OldPosition = null;
            }
            else
            {
                m_OldPosition = PointGeometry.Create(polPos);
            }

            m_NewPosition = to;

            // Move the reference position (and rework any enclosing polygon)
            m_Label.SetPolPosition(m_NewPosition);

            // Peform standard completion steps
            Complete();
        }