internal PressAndTapEventArgs(GestureInfo info) : base(info) { int pointsStruct = LoDWord(info.arguments); Distance = new Point(LoWord(pointsStruct), HiWord(pointsStruct)); }
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); }
private bool OnTwoFingerTap(GestureInfo info) { if (TwoFingerTap != null) { var args = new TwoFingerTapEventArgs(info); TwoFingerTap(this, args); return(args.Handled); } return(false); }
private bool OnPressAndTap(GestureInfo info) { if (PressAndTap != null) { var args = new PressAndTapEventArgs(info); PressAndTap(this, args); return(args.Handled); } return(false); }
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); }
/// <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)); }
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); }
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); }
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); }
/// <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 ); }
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; }
private bool OnTwoFingerTap( GestureInfo info ) { if ( TwoFingerTap != null ) { var args = new TwoFingerTapEventArgs( info ); TwoFingerTap( this, args ); return args.Handled; } return false; }
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; }
private bool OnPressAndTap( GestureInfo info ) { if ( PressAndTap != null ) { var args = new PressAndTapEventArgs( info ); PressAndTap( this, args ); return args.Handled; } return false; }
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; }
internal ZoomEventArgs(GestureInfo info, long lastZoomDistance) : base(info) { Distance = info.arguments; PercentChange = (double)Distance / lastZoomDistance; }
internal GestureEventArgs(GestureInfo info) { Location = new Point(info.location.x, info.location.y); Info = info; Handled = true; }
internal TwoFingerTapEventArgs(GestureInfo info) : base(info) { Distance = info.arguments; }