private void unregisterFriendlyGesture(Gesture gesture) { if (gesture == null || gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) { return; } friendlyGestureIds.Remove(gesture.GetInstanceID()); }
internal void RegisterFriendlyGesture(Gesture gesture) { if (gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) { return; } friendlyGestureIds.Add(gesture.GetInstanceID()); }
/// <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)); } }
// Gets also called by the custom inspector. private void addFriendlyGestureId(Gesture gesture) { var id = gesture.GetInstanceID(); if (!friendlyGestureIds.Contains(id)) { friendlyGestureIds.Add(id); } }
/// <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); } }
// Gets also called by the custom inspector. private void removeFriendlyGestureId(Gesture gesture) { friendlyGestureIds.Remove(gesture.GetInstanceID()); }
/// <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())); }
/// <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); } }
// Gets also called by the custom inspector. private void addFriendlyGestureId(Gesture gesture) { var id = gesture.GetInstanceID(); if (!friendlyGestureIds.Contains(id)) friendlyGestureIds.Add(id); }
private void unregisterFriendlyGesture(Gesture gesture) { if (gesture == null || gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) return; friendlyGestureIds.Remove(gesture.GetInstanceID()); }
internal void UnregisterFriendlyGesture(Gesture gesture) { friendlyGestureIds.Remove(gesture.GetInstanceID()); }
internal void RegisterFriendlyGesture(Gesture gesture) { if (gesture == this || friendlyGestureIds.Contains(gesture.GetInstanceID())) return; friendlyGestureIds.Add(gesture.GetInstanceID()); }
{ 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>
/// <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;
/// <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()); }