Пример #1
0
        ///
        /// <summary>
        /// Calculate distance in pixels for each inertial step and start deceleration timer</summary>
        ///
        private void InitializeInertialMove(
            )
        {
            int trackingTime;

            trackingTime = (int)(m_p2time - m_p1time).TotalMilliseconds;

            m_timer.Stop();
            m_element.ReleaseMouseCapture();

            m_timer.Interval = TimeSpan.FromMilliseconds(DECELERATION_INTERVAL);
            m_timer.Start();

            MovingScroll = this;

            m_incrementX = ((m_p2.X - m_p1.X) / trackingTime) * DECELERATION_INTERVAL;
            m_incrementY = ((m_p2.Y - m_p1.Y) / trackingTime) * DECELERATION_INTERVAL;
        }
Пример #2
0
        public void Release(
            )
        {
            bool sendDragStop;

            MovingScroll = null;

            sendDragStop       = (m_inertialDragging || m_manualDragging);
            m_inertialDragging = false;
            m_manualDragging   = false;

            m_element.ReleaseMouseCapture();
            m_timer.Stop();

            if (OnDragStop != null && sendDragStop)
            {
                OnDragStop(m_p2);
            }
        }
        /// 
        /// <summary>
        /// Calculate distance in pixels for each inertial step and start deceleration timer</summary>
        /// 
        private void InitializeInertialMove(
        )
        {
            int                                         trackingTime;

            trackingTime = (int) (m_p2time - m_p1time).TotalMilliseconds;

            m_timer.Stop();
            m_element.ReleaseMouseCapture();

            m_timer.Interval = TimeSpan.FromMilliseconds(DECELERATION_INTERVAL);
            m_timer.Start();

            MovingScroll = this;

            m_incrementX = ((m_p2.X - m_p1.X) / trackingTime) * DECELERATION_INTERVAL;
            m_incrementY = ((m_p2.Y - m_p1.Y) / trackingTime) * DECELERATION_INTERVAL;
        }
        public void Release(
        )
        {
            bool                                        sendDragStop;

            MovingScroll = null;

            sendDragStop = (m_inertialDragging || m_manualDragging);
            m_inertialDragging = false;
            m_manualDragging = false;

            m_element.ReleaseMouseCapture();
            m_timer.Stop();

            if (OnDragStop != null && sendDragStop)
            {
                OnDragStop(m_p2);
            }
        }