Esempio n. 1
0
        protected void EndResizeOperation(MouseEventArgs e)
        {
            if (_resizeSource != null)
            {
                // Undraw the current position
                DrawResizeIndicator(_pointCurrent);

                // Find new screen position
                Point newCurrent = PointToScreen(new Point(e.X, e.Y));

                // Limit the extend the bar can be moved
                ApplyBoundaryToPoint(ref newCurrent);

                // Calculate delta from initial resize
                Point delta = new Point(newCurrent.X - _pointStart.X,
                                        newCurrent.Y - _pointStart.Y);

                // Inform the Zone of requested change
                if (_direction == Direction.Horizontal)
                {
                    _resizeSource.EndResizeOperation(this, delta.X);
                }
                else
                {
                    _resizeSource.EndResizeOperation(this, delta.Y);
                }
            }

            _resizing = false;
        }
Esempio n. 2
0
        private void EndResizeOperation(MouseEventArgs e)
        {
            if (_resizeSource != null)
            {
                // Set last drawn rect to nothing, otherwise drawing the rectangle in exactly
                // the same place as the last time around would cause a null effect due to the
                // code used to reduce flicker by only drawing the delta changes.
                _lastRect = Rectangle.Empty;

                // Undraw the current position
                DrawResizeIndicator(_pointCurrent);

                // Find new screen position
                Point newCurrent = PointToScreen(new Point(e.X, e.Y));

                // Limit the extent the bar can be moved
                ApplyBoundaryToPoint(ref newCurrent);

                // Calculate delta from initial resize
                Point delta = new Point(newCurrent.X - _pointStart.X,
                                        newCurrent.Y - _pointStart.Y);

                // Inform the Zone of requested change
                if (_direction == LayoutDirection.Horizontal)
                {
                    _resizeSource.EndResizeOperation(this, delta.X);
                }
                else
                {
                    _resizeSource.EndResizeOperation(this, delta.Y);
                }
            }

            _resizing = false;
        }