Пример #1
0
 void UpdateGestureDirection(RoutedEventArgs originalArgs)
 {
     if (_direction == C1DragDirection.None)
     {
         Point  position = C1InputEventArgs.GetPosition(originalArgs, null);
         double x        = position.X - _origin.X;
         double num2     = position.Y - _origin.Y;
         if ((x != 0.0) || (num2 != 0.0))
         {
             double num3 = Math.Sqrt(Math.Pow(x, 2.0) + Math.Pow(num2, 2.0));
             double num4 = x / num3;
             double num5 = num2 / num3;
             if (Math.Abs(num5) < 0.4)
             {
                 _direction = C1DragDirection.Horizontal;
             }
             else if (Math.Abs(num4) < 0.4)
             {
                 _direction = C1DragDirection.Vertical;
             }
             else
             {
                 _direction = C1DragDirection.Diagonal;
             }
         }
     }
 }
Пример #2
0
 internal void Complete(RoutedEventArgs originalArgs = null)
 {
     if (_dragStarted)
     {
         _dragStarted    = false;
         _pointerPressed = false;
         ReleaseMouseCapture();
         _manipulationStarted         = false;
         _velocity                    = new Point();
         _direction                   = C1DragDirection.None;
         CompositionTarget.Rendering -= OnRendering;
         RaiseDragCompleted(originalArgs, _cumulativeTranslation);
     }
 }
 internal C1DragStartedEventArgs(C1DragHelper helper, RoutedEventArgs originalArgs, C1PointerDeviceType pointerType, Point origin, C1DragDirection direction)
     : base(helper, originalArgs, pointerType)
 {
     Origin = origin;
     Direction = direction;
 }
Пример #4
0
 // Methods
 internal C1DragStartedEventArgs(C1DragHelper helper, RoutedEventArgs originalArgs, C1PointerDeviceType pointerType, Point origin, C1DragDirection direction)
     : base(helper, originalArgs, pointerType)
 {
     Origin    = origin;
     Direction = direction;
 }
Пример #5
0
 private void UpdateGestureDirection(RoutedEventArgs originalArgs)
 {
     if (_direction == C1DragDirection.None)
     {
         var position = C1InputEventArgs.GetPosition(originalArgs, null);
         var x = position.X - _origin.X;
         var y = position.Y - _origin.Y;
         if (x != 0 || y != 0)
         {
             var num = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
             var num1 = x/num;
             if (Math.Abs(y/num) < 0.4)
             {
                 _direction = C1DragDirection.Horizontal;
                 return;
             }
             if (Math.Abs(num1) < 0.4)
             {
                 _direction = C1DragDirection.Vertical;
                 return;
             }
             _direction = C1DragDirection.Diagonal;
         }
     }
 }
Пример #6
0
 internal void Complete(RoutedEventArgs originalArgs = null)
 {
     if (_dragStarted)
     {
         _dragStarted = false;
         _pointerPressed = false;
         ReleaseMouseCapture();
         _manipulationStarted = false;
         _velocity = new Point();
         _direction = C1DragDirection.None;
         CompositionTarget.Rendering -= OnRendering;
         RaiseDragCompleted(originalArgs, _cumulativeTranslation);
     }
 }