/// <summary> /// Invokes the <see cref="GestureDetected"/> event. /// </summary> /// <param name="gestureId"></param> protected void OnGestureDetected(GestureId gestureId) { if (GestureDetected != null) { GestureDetected.Invoke(gestureId); } }
/// <summary> /// Invokes the <see cref="SensorsUpdated"/> event. /// If the frame contains a gesture, also invokes the <see cref="GestureDetected"/> event. /// </summary> /// <param name="frame"></param> private void OnSensorsUpdated(SensorFrame frame) { if (SensorsUpdated != null) { SensorsUpdated.Invoke(frame); } if (frame.gestureId != GestureId.None) { if (GestureDetected != null) { GestureDetected.Invoke(frame.gestureId); } switch (frame.gestureId) { case GestureId.DoubleTap: if (DoubleTapDetected != null) { DoubleTapDetected.Invoke(); } break; case GestureId.None: default: throw new ArgumentOutOfRangeException(); } } }