public bool OnEvent(BaseEvent baseEvent) { if (baseEvent is TouchEvent) { TouchEvent e = (TouchEvent)baseEvent; switch (e.EventMessage) { case (byte)TouchMessages.Down: HandleTouchDownEvent(e); break; case (byte)TouchMessages.Move: HandleTouchMoveEvent(e); break; case (byte)TouchMessages.Up: HandleTouchUpEvent(e); break; } } else if (baseEvent is GenericEvent) { GenericEvent e = (GenericEvent)baseEvent; if (e.EventCategory == (byte)EventCategory.Gesture) { TouchGestureEventArgs args = new TouchGestureEventArgs((TouchGesture)e.EventMessage, e.X, e.Y, (ushort)e.EventData, e.Time); switch (args.Gesture) { case TouchGesture.Begin: NotifyTouchGestureStarted(args); break; case TouchGesture.End: NotifyTouchGestureEnded(args); break; default: NotifyTouchGestureChanged(args); break; } } } return(true); }
private static void NotifyTouchGestureEnded(TouchGestureEventArgs e) { if (TouchGestureEnded != null) { TouchGestureEnded(null, e); } }
private static void NotifyTouchGestureStarted(TouchGestureEventArgs e) { if (TouchGestureStarted != null) TouchGestureStarted(null, e); }
public bool OnEvent(BaseEvent baseEvent) { if (baseEvent is TouchEvent) { TouchEvent e = (TouchEvent)baseEvent; switch (e.EventMessage) { case (byte)TouchMessages.Down: HandleTouchDownEvent(e); break; case (byte)TouchMessages.Move: HandleTouchMoveEvent(e); break; case (byte)TouchMessages.Up: HandleTouchUpEvent(e); break; } } else if (baseEvent is GenericEvent) { GenericEvent e = (GenericEvent)baseEvent; if (e.EventCategory == (byte)EventCategory.Gesture) { TouchGestureEventArgs args = new TouchGestureEventArgs((TouchGesture)e.EventMessage, e.X, e.Y, (ushort)e.EventData, e.Time); switch (args.Gesture) { case TouchGesture.Begin: NotifyTouchGestureStarted(args); break; case TouchGesture.End: NotifyTouchGestureEnded(args); break; default: NotifyTouchGestureChanged(args); break; } } } return true; }
protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e) { if (TouchGestureStart != null) { TouchGestureStart(this, e); } }
protected virtual void OnGenericEvent(GenericEventArgs e) { GenericEvent genericEvent = e.InternalEvent; switch (genericEvent.EventCategory) { case (byte)EventCategory.Gesture: { TouchGestureEventArgs ge = new TouchGestureEventArgs(); ge.Gesture = (TouchGesture)genericEvent.EventMessage; ge.X = genericEvent.X; ge.Y = genericEvent.Y; ge.Arguments = (ushort)genericEvent.EventData; if (ge.Gesture == TouchGesture.Begin) { OnTouchGestureStarted(ge); } else if (ge.Gesture == TouchGesture.End) { OnTouchGestureEnded(ge); } else { OnTouchGestureChanged(ge); } break; } default: { break; } } }
protected virtual void OnTouchGestureEnded(TouchGestureEventArgs e) { if (TouchGestureEnd != null) { TouchGestureEnd(this, e); } }
private void TouchManager_TouchGestureStarted(object sender, TouchGestureEventArgs e) { Control touchTarget = GetTouchTarget(e.Point); if (touchTarget != null) touchTarget.RaiseTouchGestureStartedEvent(e); }
private static void OnTouchGestureEnded(TouchGestureEventArgs e) { if (TouchGestureEnded != null) TouchGestureEnded(null, e); }
protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e) { if (TouchGestureStarted != null) TouchGestureStarted(this, e); if (parent != null) parent.OnTouchGestureStarted(e); }
internal void RaiseTouchGestureStartedEvent(TouchGestureEventArgs e) { OnTouchGestureStarted(e); }
internal void RaiseTouchGestureChangedEvent(TouchGestureEventArgs e) { OnTouchGestureChanged(e); }