Exemplo n.º 1
0
        internal PressAndTapEventArgs(GestureInfo info)
            : base(info)
        {
            int pointsStruct = LoDWord(info.arguments);

            Distance = new Point(LoWord(pointsStruct), HiWord(pointsStruct));
        }
Exemplo n.º 2
0
        internal PanEventArgs(GestureInfo info, Point lastPanPoint)
            : base(info)
        {
            int hiword = HiDWord(info.arguments);

            InertiaVector = new Point(LoWord(hiword), HiWord(hiword));
            PanOffset     = new Point(Location.X - lastPanPoint.X, Location.Y - lastPanPoint.Y);
        }
Exemplo n.º 3
0
 private bool OnTwoFingerTap(GestureInfo info)
 {
     if (TwoFingerTap != null)
     {
         var args = new TwoFingerTapEventArgs(info);
         TwoFingerTap(this, args);
         return(args.Handled);
     }
     return(false);
 }
Exemplo n.º 4
0
 private bool OnPressAndTap(GestureInfo info)
 {
     if (PressAndTap != null)
     {
         var args = new PressAndTapEventArgs(info);
         PressAndTap(this, args);
         return(args.Handled);
     }
     return(false);
 }
Exemplo n.º 5
0
        internal RotateEventArgs(GestureInfo info, double lastRotation)
            : base(info)
        {
            int loword = LoDWord(info.arguments);

            TotalAngle = RotateAngleFromArgument(loword);
            Angle      = TotalAngle - lastRotation;
            string msg = string.Format("Total:{0} Angle:{1} Last:{2}", TotalAngle, Angle, lastRotation);

            System.Diagnostics.Debug.WriteLine(msg);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the gesture info.
        /// </summary>
        /// <param name="gestureInfoHandle">The gesture info handle.</param>
        /// <param name="gestureInfo">The gesture info.</param>
        /// <returns></returns>
        public static bool GetGestureInfo(IntPtr gestureInfoHandle, out GestureInfo gestureInfo)
        {
            gestureInfo = new GestureInfo();

            if (_pGetGestureInfoPtr == null)
            {
                return(false);
            }

            gestureInfo.size = Marshal.SizeOf(gestureInfo);
            return(_pGetGestureInfoPtr(gestureInfoHandle, ref gestureInfo));
        }
Exemplo n.º 7
0
 private bool OnZoom(GestureInfo info)
 {
     if (Zoom != null)
     {
         if (info.Begin)
         {
             _lastZoom = info.arguments;
         }
         var args = new ZoomEventArgs(info, _lastZoom);
         _lastZoom = args.Distance;
         Zoom(this, args);
         return(args.Handled);
     }
     return(false);
 }
Exemplo n.º 8
0
 private bool OnPan(GestureInfo info)
 {
     if (Pan != null)
     {
         if (info.Begin)
         {
             _lastPanPoint = new Point(info.location.x, info.location.y);
         }
         var args = new PanEventArgs(info, _lastPanPoint);
         _lastPanPoint = new Point(info.location.x, info.location.y);
         Pan(this, args);
         return(args.Handled);
     }
     return(false);
 }
Exemplo n.º 9
0
 private bool OnRotate(GestureInfo info)
 {
     if (Rotate != null)
     {
         if (info.Begin)
         {
             _lastRotation = 0;
         }
         var args = new RotateEventArgs(info, _lastRotation);
         if (!info.Begin)
         {
             // First rotation is the angle the fingers are at, so don't use it
             _lastRotation = args.TotalAngle;
         }
         Rotate(this, args);
         return(args.Handled);
     }
     return(false);
 }
Exemplo n.º 10
0
        /// <summary>
        /// Gets the gesture info.
        /// </summary>
        /// <param name="gestureInfoHandle">The gesture info handle.</param>
        /// <param name="gestureInfo">The gesture info.</param>
        /// <returns></returns>
        public static bool GetGestureInfo( IntPtr gestureInfoHandle, out GestureInfo gestureInfo )
        {
            gestureInfo = new GestureInfo();

            if ( _pGetGestureInfoPtr == null )
                return false;

            gestureInfo.size = Marshal.SizeOf( gestureInfo );
            return _pGetGestureInfoPtr( gestureInfoHandle, ref gestureInfo );
        }
Exemplo n.º 11
0
 private bool OnZoom( GestureInfo info )
 {
     if ( Zoom != null )
     {
         if ( info.Begin )
         {
             _lastZoom = info.arguments;
         }
         var args = new ZoomEventArgs( info, _lastZoom );
         _lastZoom = args.Distance;
         Zoom( this, args );
         return args.Handled;
     }
     return false;
 }
Exemplo n.º 12
0
 private bool OnTwoFingerTap( GestureInfo info )
 {
     if ( TwoFingerTap != null )
     {
         var args = new TwoFingerTapEventArgs( info );
         TwoFingerTap( this, args );
         return args.Handled;
     }
     return false;
 }
Exemplo n.º 13
0
 private bool OnRotate( GestureInfo info )
 {
     if ( Rotate != null )
     {
         if ( info.Begin )
         {
             _lastRotation = 0;
         }
         var args = new RotateEventArgs( info, _lastRotation );
         if ( !info.Begin )
         {
             // First rotation is the angle the fingers are at, so don't use it
             _lastRotation = args.TotalAngle;
         }
         Rotate( this, args );
         return args.Handled;
     }
     return false;
 }
Exemplo n.º 14
0
 private bool OnPressAndTap( GestureInfo info )
 {
     if ( PressAndTap != null )
     {
         var args = new PressAndTapEventArgs( info );
         PressAndTap( this, args );
         return args.Handled;
     }
     return false;
 }
Exemplo n.º 15
0
 private bool OnPan( GestureInfo info )
 {
     if ( Pan != null )
     {
         if ( info.Begin )
         {
             _lastPanPoint = new Point( info.location.x, info.location.y );
         }
         var args = new PanEventArgs( info, _lastPanPoint );
         _lastPanPoint = new Point( info.location.x, info.location.y );
         Pan( this, args );
         return args.Handled;
     }
     return false;
 }
Exemplo n.º 16
0
 internal ZoomEventArgs(GestureInfo info, long lastZoomDistance)
     : base(info)
 {
     Distance      = info.arguments;
     PercentChange = (double)Distance / lastZoomDistance;
 }
Exemplo n.º 17
0
 internal GestureEventArgs(GestureInfo info)
 {
     Location = new Point(info.location.x, info.location.y);
     Info     = info;
     Handled  = true;
 }
Exemplo n.º 18
0
 internal TwoFingerTapEventArgs(GestureInfo info)
     : base(info)
 {
     Distance = info.arguments;
 }