Пример #1
0
    /// <summary>
    /// This controls whether or not the gesture recognition should begin
    /// </summary>
    /// <param name="touches">The active touches</param>
    protected virtual bool CanBegin(T gesture, FingerGestures.IFingerList touches)
    {
        if (touches.Count != RequiredFingerCount)
        {
            return(false);
        }

        if (IsExclusive && FingerGestures.Touches.Count != RequiredFingerCount)
        {
            return(false);
        }

        // check with the delegate (provided we have one set)
        if (Delegate && !Delegate.CanBegin(gesture, touches))
        {
            return(false);
        }

        return(true);
    }