コード例 #1
0
ファイル: TouchManager.cs プロジェクト: radtek/MFE
            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);
            }
コード例 #2
0
ファイル: TouchManager.cs プロジェクト: radtek/MFE
 private static void NotifyTouchGestureEnded(TouchGestureEventArgs e)
 {
     if (TouchGestureEnded != null)
     {
         TouchGestureEnded(null, e);
     }
 }
コード例 #3
0
 private static void NotifyTouchGestureStarted(TouchGestureEventArgs e)
 {
     if (TouchGestureStarted != null)
         TouchGestureStarted(null, e);
 }
コード例 #4
0
            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;
            }
コード例 #5
0
 protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e)
 {
     if (TouchGestureStart != null)
     {
         TouchGestureStart(this, e);
     }
 }
コード例 #6
0
        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;
                    }
            }
        }
コード例 #7
0
 protected virtual void OnTouchGestureEnded(TouchGestureEventArgs e)
 {
     if (TouchGestureEnd != null)
     {
         TouchGestureEnd(this, e);
     }
 }
コード例 #8
0
 private void TouchManager_TouchGestureStarted(object sender, TouchGestureEventArgs e)
 {
     Control touchTarget = GetTouchTarget(e.Point);
     if (touchTarget != null)
         touchTarget.RaiseTouchGestureStartedEvent(e);
 }
コード例 #9
0
 private static void OnTouchGestureEnded(TouchGestureEventArgs e)
 {
     if (TouchGestureEnded != null)
         TouchGestureEnded(null, e);
 }
コード例 #10
0
ファイル: Control.cs プロジェクト: KonstantinKolesnik/MFE
        protected virtual void OnTouchGestureStarted(TouchGestureEventArgs e)
        {
            if (TouchGestureStarted != null)
                TouchGestureStarted(this, e);

            if (parent != null)
                parent.OnTouchGestureStarted(e);
        }
コード例 #11
0
ファイル: Control.cs プロジェクト: KonstantinKolesnik/MFE
 internal void RaiseTouchGestureStartedEvent(TouchGestureEventArgs e)
 {
     OnTouchGestureStarted(e);
 }
コード例 #12
0
ファイル: Control.cs プロジェクト: KonstantinKolesnik/MFE
 internal void RaiseTouchGestureChangedEvent(TouchGestureEventArgs e)
 {
     OnTouchGestureChanged(e);
 }