/// <summary> /// Updates the gesture. /// </summary> /// <param name="data">The skeleton data.</param> public void UpdateGesture(Skeleton data, AllFramesReadyEventArgs e, GestureStatus gestureStatus) { if (!this.ShouldExecut()) { return; } GesturePartResult result = this.gestureParts.CheckGesture(data, e, gestureStatus); if (result == GesturePartResult.Suceed) { if (this.GestureRecognized != null) { // Success & send event this.GestureRecognized(this, new GestureEventArgs(this.type, gestureStatus, data.TrackingId)); // Flush gesture status if a gesture recognized if (this.type != GestureType.HandCloseOrOpen) { gestureStatus.GestureStatusFlush(); } } } }
/// <summary> /// Initializes a new instance of the <see cref="GestureEventArgs"/> class. /// </summary> /// <param name="type">The gesture type.</param> /// <param name="trackingID">The tracking ID.</param> /// <param name="userID">The user ID.</param> public GestureEventArgs(GestureType type, GestureStatus stat, int trackingId) { this.TrackingId = trackingId; this.GestureType = type; this.GestureStatus = stat; }
/// <summary> /// Updates the gesture. /// </summary> /// <param name="data">The skeleton data.</param> public void UpdateGesture(Skeleton data, AllFramesReadyEventArgs e, GestureStatus gestureStatus) { if (!this.ShouldExecut()) return; GesturePartResult result = this.gestureParts.CheckGesture(data, e, gestureStatus); if (result == GesturePartResult.Suceed) { if (this.GestureRecognized != null) { // Success & send event this.GestureRecognized(this, new GestureEventArgs(this.type, gestureStatus, data.TrackingId)); // Flush gesture status if a gesture recognized if(this.type != GestureType.HandCloseOrOpen) gestureStatus.GestureStatusFlush(); } } }