コード例 #1
0
    protected override bool CanBegin( FingerGestures.IFingerList touches )
    {
        if( !base.CanBegin( touches ) )
            return false;

        if( touches.GetAverageDistanceFromStart() < MoveTolerance )
            return false;

        return true;
    }
コード例 #2
0
    protected override GestureState OnActive( FingerGestures.IFingerList touches )
    {
        if( touches.Count != RequiredFingerCount )
            return GestureState.Failed;

        if( ElapsedTime >= Duration )
        {
            RaiseOnLongPress();
            return GestureState.Recognized;
        }

        // check if we moved too far from initial position
        if( touches.GetAverageDistanceFromStart() > MoveTolerance )
            return GestureState.Failed;

        return GestureState.InProgress;
    }