Ejemplo n.º 1
0
 protected virtual void ClearDnDState()
 {
     _isStarted               = false;
     _dragStartPoint          = Point.Empty;
     _dragStartRect           = Rectangle.Empty;
     _dragStartMouseEventArgs = null;
 }
Ejemplo n.º 2
0
        // ------------------------------
        // protected
        // ------------------------------
        protected virtual void OnMouseDown(MouseEventArgs e)
        {
            _dragStartPoint = e.Location;
            _dragStartRect  = new Rectangle(
                new Point(e.X - _dragSize.Width / 2, e.Y - _dragSize.Height / 2),
                _dragSize
                );
            _dragStartMouseEventArgs = new CancelMouseEventArgs(e);

            if (_isStarted && e.Button == MouseButtons.Right)
            {
                CancelDrag();
            }

            ProcessClickCount(e);
            if (e.Clicks != _clickCount)
            {
                e = new MouseEventArgs(e.Button, _clickCount, e.X, e.Y, e.Delta);
            }

            var handler = MouseDown;

            if (handler != null)
            {
                handler(_eventSender, e);
            }
        }