private void OnGesture(CocoGestureType gestureType, ContinuousGesture gesture) { switch (gesture.Phase) { case ContinuousGesturePhase.Started: StartGestureActiving(gestureType); if (ShouldIgnoreGesture(gestureType, gesture.StartPosition)) { break; } if (!StartGestureProcess(gestureType)) { break; } ProcessGestureData(gestureType, gesture); break; case ContinuousGesturePhase.Updated: ProcessGestureData(gestureType, gesture); break; case ContinuousGesturePhase.Ended: if (ProcessGestureData(gestureType, gesture)) { EndGestureProcess(gestureType); } EndGestureActiving(gestureType); break; } }
public override void CancelGestureProcess() { if (!typeof(T).IsSubclassOf(typeof(ContinuousGesture))) { return; } T gesture = new T(); ContinuousGesture cg = gesture as ContinuousGesture; if (cg == null) { return; } cg.State = GestureRecognitionState.Ended; ProcessGesture(gesture); }