private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs) { update(touchEventArgs.Touch, _processTarget, _updateCancelled); }
private void touchesCancelledHandler(object sender, TouchEventArgs e) { sendMessageTarget.SendMessage(MessageName.OnTouchesCancelled.ToString(), e.Touches, SendMessageOptions.DontRequireReceiver); }
private void touchesEndedHandler(object sender, TouchEventArgs touchEventArgs) { update(touchEventArgs.Touches, _processTarget, _updateEnded); }
private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs) { update(touchEventArgs.Touch, _processTargetBegan, _updateBegan); }
private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs) { updateCancelled(touchEventArgs.Touches); }
/// <summary> /// Returns cached instance of EventArgs. /// This cached EventArgs is reused throughout the library not to alocate new ones on every call. /// </summary> /// <param name="touch"> Touch for the event. </param> /// <returns>Cached EventArgs object.</returns> public static TouchEventArgs GetCachedEventArgs(TouchPoint touch) { if (instance == null) instance = new TouchEventArgs(); instance.Touch = touch; return instance; }
private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs) { updateBegan(touchEventArgs.Touches); }
private void touchMovedHandler(object sender, TouchEventArgs touchEventArgs) { updateMoved(touchEventArgs.Touches); }
/// <summary> /// Returns cached instance of EventArgs. /// This cached EventArgs is reused throughout the library not to alocate new ones on every call. /// </summary> /// <param name="touches">A list of touches for event.</param> /// <returns>Cached EventArgs object.</returns> public static TouchEventArgs GetCachedEventArgs(IList<TouchPoint> touches) { if (instance == null) instance = new TouchEventArgs(); instance.Touches = touches; return instance; }
private void updateManuallyCancelled(List <CancelledTouch> points) { var cancelledCount = points.Count; var list = touchListPool.Get(); var redispatchList = touchListPool.Get(); var releaseList = touchListPool.Get(); for (var i = 0; i < cancelledCount; i++) { var data = points[i]; var id = data.Id; TouchPoint touch; if (!idToTouch.TryGetValue(id, out touch)) { // might be dead already continue; } if (data.Redispatch) { redispatchList.Add(touch); } else { idToTouch.Remove(id); touches.Remove(touch); releaseList.Add(touch); #if DEBUG removeDebugFigureForTouch(touch); #endif } list.Add(touch); if (touch.Layer != null) { touch.Layer.INTERNAL_CancelTouch(touch); } } if (touchesCancelledInvoker != null) { touchesCancelledInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(list)); } touchListPool.Release(list); var count = releaseList.Count; for (var i = 0; i < count; i++) { touchPointPool.Release(releaseList[i] as TouchPoint); } touchListPool.Release(releaseList); count = redispatchList.Count; if (count > 0) { var layerCount = layers.Count; for (var i = 0; i < count; i++) { var touch = redispatchList[i] as TouchPoint; for (var j = 0; j < layerCount; j++) { var touchLayer = Layers[j]; if (touchLayer == null) { continue; } if (touchLayer.INTERNAL_BeginTouch(touch)) { break; } } } if (touchesBeganInvoker != null) { touchesBeganInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(redispatchList)); } } touchListPool.Release(redispatchList); }
private void touchesCancelledHandler(object sender, TouchEventArgs touchEventArgs) { update(touchEventArgs.Touches, _processTarget, _updateCancelled); }
private void touchesBeganHandler(object sender, TouchEventArgs touchEventArgs) { update(touchEventArgs.Touches, _processTargetBegan, _updateBegan); }