示例#1
0
        private void unregisterFriendlyGesture(Gesture gesture)
        {
            if (gesture == null || gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID()))
            {
                return;
            }

            friendlyGestureIds.Remove(gesture.GetInstanceID());
        }
示例#2
0
        internal void RegisterFriendlyGesture(Gesture gesture)
        {
            if (gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID()))
            {
                return;
            }

            friendlyGestureIds.Add(gesture.GetInstanceID());
        }
示例#3
0
 /// <summary>
 /// Determines whether this instance can prevent the specified gesture.
 /// </summary>
 /// <param name="gesture">The gesture.</param>
 /// <returns>
 ///   <c>true</c> if this instance can prevent the specified gesture; otherwise, <c>false</c>.
 /// </returns>
 public virtual bool CanPreventGesture(Gesture gesture)
 {
     if (Delegate == null)
     {
         if (gesture.CanBePreventedByGesture(this))
         {
             if (shouldRecognizeWith.Contains(gesture.GetInstanceID()))
             {
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(!Delegate.ShouldRecognizeSimultaneously(this, gesture));
     }
 }
示例#4
0
        // Gets also called by the custom inspector.
        private void addFriendlyGestureId(Gesture gesture)
        {
            var id = gesture.GetInstanceID();

            if (!friendlyGestureIds.Contains(id))
            {
                friendlyGestureIds.Add(id);
            }
        }
示例#5
0
        /// <summary>
        /// Tells that the gesture should (or shouldn't) work simultaneously with this gesture.
        /// </summary>
        /// <param name="gesture">The gesture.</param>
        /// <param name="value">if set to <c>true</c> allows simultaneous recognition.</param>
        public void ShouldRecognizeSimultaneouslyWith(Gesture gesture, bool value = true)
        {
            if (gesture == this)
            {
                return;
            }

            var id = gesture.GetInstanceID();

            if (value && !shouldRecognizeWith.Contains(id))
            {
                shouldRecognizeWith.Add(id);
            }
            else
            {
                shouldRecognizeWith.Remove(id);
            }
        }
示例#6
0
 // Gets also called by the custom inspector.
 private void removeFriendlyGestureId(Gesture gesture)
 {
     friendlyGestureIds.Remove(gesture.GetInstanceID());
 }
示例#7
0
 /// <summary>
 /// Checks if a gesture is friendly with this gesture.
 /// </summary>
 /// <param name="gesture">A gesture to check.</param>
 /// <returns>True if gestures are friendly; false otherwise.</returns>
 public bool IsFriendly(Gesture gesture)
 {
     return(friendlyGestureIds.Contains(gesture.GetInstanceID()));
 }
示例#8
0
 /// <summary>
 /// Determines whether this instance can prevent the specified gesture.
 /// </summary>
 /// <param name="gesture">The gesture.</param>
 /// <returns>
 ///   <c>true</c> if this instance can prevent the specified gesture; otherwise, <c>false</c>.
 /// </returns>
 public virtual bool CanPreventGesture(Gesture gesture)
 {
     if (Delegate == null)
     {
         if (gesture.CanBePreventedByGesture(this))
         {
             if (shouldRecognizeWith.Contains(gesture.GetInstanceID()))
             {
                 return false;
             } else
             {
                 return true;
             }
         } else
         {
             return false;
         }
     } else
     {
         return !Delegate.ShouldRecognizeSimultaneously(this, gesture);
     }
 }
示例#9
0
 // Gets also called by the custom inspector.
 private void removeFriendlyGestureId(Gesture gesture)
 {
     friendlyGestureIds.Remove(gesture.GetInstanceID());
 }
示例#10
0
 // Gets also called by the custom inspector.
 private void addFriendlyGestureId(Gesture gesture)
 {
     var id = gesture.GetInstanceID();
     if (!friendlyGestureIds.Contains(id)) friendlyGestureIds.Add(id);
 }
示例#11
0
        private void unregisterFriendlyGesture(Gesture gesture)
        {
            if (gesture == null || gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) return;

            friendlyGestureIds.Remove(gesture.GetInstanceID());
        }
示例#12
0
 internal void UnregisterFriendlyGesture(Gesture gesture)
 {
     friendlyGestureIds.Remove(gesture.GetInstanceID());
 }
示例#13
0
 internal void UnregisterFriendlyGesture(Gesture gesture)
 {
     friendlyGestureIds.Remove(gesture.GetInstanceID());
 }
示例#14
0
        internal void RegisterFriendlyGesture(Gesture gesture)
        {
            if (gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) return;

            friendlyGestureIds.Add(gesture.GetInstanceID());
        }
示例#15
0
        {
            get; private set;
        }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Determines whether this instance can prevent the specified gesture.
        /// </summary>
        /// <param name="gesture">The gesture.</param>
        /// <returns>
示例#16
0
        /// <param name="touch">The touch.</param>
        /// <returns><c>true</c> if this touch should be received by the gesture; otherwise, <c>false</c>.</returns>
        public virtual bool ShouldReceiveTouch(TouchPoint touch)
        {
            if (Delegate == null) return true;
            return Delegate.ShouldReceiveTouch(this, touch);
        }

        /// <summary>
        /// Tells that the gesture should (or shouldn't) work simultaneously with this gesture.
        /// </summary>
        /// <param name="gesture">The gesture.</param>
        /// <param name="value">if set to <c>true</c> allows simultaneous recognition.</param>
        public void ShouldRecognizeSimultaneouslyWith(Gesture gesture, bool value = true)
        {
            if (gesture == this) return;
示例#17
0
 /// <summary>
 /// Checks if a gesture is friendly with this gesture.
 /// </summary>
 /// <param name="gesture">A gesture to check.</param>
 /// <returns>True if gestures are friendly; false otherwise.</returns>
 public bool IsFriendly(Gesture gesture)
 {
     return friendlyGestureIds.Contains(gesture.GetInstanceID());
 }