Exemple #1
0
        private void InvokeNavigationEvent(GestureRecognizer.GestureEventType eventType, InteractionSourceKind source, Vector3 relativePosition, Ray headRay)
        {
            switch (eventType)
            {
            case GestureRecognizer.GestureEventType.NavigationCanceled:
            {
                GestureRecognizer.NavigationCanceledEventDelegate navigationCanceledEvent = this.NavigationCanceledEvent;
                if (navigationCanceledEvent != null)
                {
                    navigationCanceledEvent(source, relativePosition, headRay);
                }
                break;
            }

            case GestureRecognizer.GestureEventType.NavigationCompleted:
            {
                GestureRecognizer.NavigationCompletedEventDelegate navigationCompletedEvent = this.NavigationCompletedEvent;
                if (navigationCompletedEvent != null)
                {
                    navigationCompletedEvent(source, relativePosition, headRay);
                }
                break;
            }

            case GestureRecognizer.GestureEventType.NavigationStarted:
            {
                GestureRecognizer.NavigationStartedEventDelegate navigationStartedEvent = this.NavigationStartedEvent;
                if (navigationStartedEvent != null)
                {
                    navigationStartedEvent(source, relativePosition, headRay);
                }
                break;
            }

            case GestureRecognizer.GestureEventType.NavigationUpdated:
            {
                GestureRecognizer.NavigationUpdatedEventDelegate navigationUpdatedEvent = this.NavigationUpdatedEvent;
                if (navigationUpdatedEvent != null)
                {
                    navigationUpdatedEvent(source, relativePosition, headRay);
                }
                break;
            }

            default:
                throw new ArgumentException("InvokeNavigationEvent: Invalid GestureEventType");
            }
        }
Exemple #2
0
        private void InvokeHoldEvent(GestureRecognizer.GestureEventType eventType, InteractionSourceKind source, Ray headRay)
        {
            switch (eventType)
            {
            case GestureRecognizer.GestureEventType.HoldCanceled:
            {
                GestureRecognizer.HoldCanceledEventDelegate holdCanceledEvent = this.HoldCanceledEvent;
                if (holdCanceledEvent != null)
                {
                    holdCanceledEvent(source, headRay);
                }
                break;
            }

            case GestureRecognizer.GestureEventType.HoldCompleted:
            {
                GestureRecognizer.HoldCompletedEventDelegate holdCompletedEvent = this.HoldCompletedEvent;
                if (holdCompletedEvent != null)
                {
                    holdCompletedEvent(source, headRay);
                }
                break;
            }

            case GestureRecognizer.GestureEventType.HoldStarted:
            {
                GestureRecognizer.HoldStartedEventDelegate holdStartedEvent = this.HoldStartedEvent;
                if (holdStartedEvent != null)
                {
                    holdStartedEvent(source, headRay);
                }
                break;
            }

            default:
                throw new ArgumentException("InvokeHoldEvent: Invalid GestureEventType");
            }
        }
Exemple #3
0
 private void InvokeRecognitionEvent(GestureRecognizer.GestureEventType eventType, InteractionSourceKind source, Ray headRay)
 {
     if (eventType != GestureRecognizer.GestureEventType.RecognitionEnded)
     {
         if (eventType != GestureRecognizer.GestureEventType.RecognitionStarted)
         {
             throw new ArgumentException("InvokeRecognitionEvent: Invalid GestureEventType");
         }
         GestureRecognizer.RecognitionStartedEventDelegate recognitionStartedEvent = this.RecognitionStartedEvent;
         if (recognitionStartedEvent != null)
         {
             recognitionStartedEvent(source, headRay);
         }
     }
     else
     {
         GestureRecognizer.RecognitionEndedEventDelegate recognitionEndedEvent = this.RecognitionEndedEvent;
         if (recognitionEndedEvent != null)
         {
             recognitionEndedEvent(source, headRay);
         }
     }
 }