コード例 #1
0
        private void GridGesture(object sender, StylusSystemGestureEventArgs e)
        {
            if (e.SystemGesture != SystemGesture.Drag)
                return;

            Debug.WriteLine("GridGesture event captured.");

            var newPoints = e.GetStylusPoints(MainImage);
            bool isReverse = false;
            if (newPoints.Count > 0 && _downPoints.Count > 0)
            {
                var distX = newPoints[0].X - _downPoints[0].X;
                var distY = newPoints[0].Y - _downPoints[0].Y;

                Debug.WriteLine(string.Format("Xoffset: {0}, Yoffset: {1}", distX, distY));

                if (Math.Abs(distX) > Math.Abs(distY))
                {
                    isReverse = distX < 0; // Horizontal
                }
                else
                {
                    return; // Vertical 

                }
            }
            if (isReverse)
            {
                PreviousFile();
            }
            else
            {
                NextFile();
            }
        }
コード例 #2
0
ファイル: CameraController.cs プロジェクト: litdev1/LitDev
        /// <summary>
        /// Invoked when an unhandled StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="T:System.Windows.Input.StylusSystemGestureEventArgs" /> that contains the event data.
        /// </param>
        protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
        {
            base.OnStylusSystemGesture(e);

            // Debug.WriteLine("OnStylusSystemGesture: " + e.SystemGesture);
            if (e.SystemGesture == SystemGesture.HoldEnter)
            {
                Point p = e.GetPosition(this);
                this.changeLookAtHandler.Started(new ManipulationEventArgs(p));
                this.changeLookAtHandler.Completed(new ManipulationEventArgs(p));
                e.Handled = true;
            }

            /// DELETED BY SJT FOR .NET 3.5
            //if (e.SystemGesture == SystemGesture.TwoFingerTap)
            //{
            //    this.ZoomExtents();
            //    e.Handled = true;
            //}
        }
コード例 #3
0
		public virtual void OnStylusSystemGesture(object sender, StylusSystemGestureEventArgs e) { }
コード例 #4
0
ファイル: InfoGrid.cs プロジェクト: DebugOfTheRoad/BigData
        void BorrowLabelGesture(object sender, StylusSystemGestureEventArgs args) {
            if (args.SystemGesture != SystemGesture.Tap) { return; }

            RemoveBorrowLabel();
            args.Handled = true;
        }
コード例 #5
0
 /// <summary>
 ///     Virtual method reporting a stylus system gesture
 /// </summary>
 protected virtual void OnPreviewStylusSystemGesture(StylusSystemGestureEventArgs e) {}
コード例 #6
0
		void ManipulationElement_StylusSystemGesture(object sender, StylusSystemGestureEventArgs e) {
			foreach (var m in mouseProcessors) {
				if (e.Handled)
					break;
				m.PreprocessStylusSystemGesture(e);
			}
			if (!e.Handled)
				defaultMouseProcessor.OnStylusSystemGesture(sender, e);
			foreach (var m in mouseProcessors)
				m.PostprocessStylusSystemGesture(e);
		}
コード例 #7
0
 private void DragSource_PreviewStylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
 {
     if (e.SystemGesture == SystemGesture.TwoFingerTap)
     {
         // cancel drag operation
         this.draggedData = null;
         _ignoreNextTouchDownEvent = true;
         //Console.WriteLine("preview mouse dbl click, cancel");
     }
 }
コード例 #8
0
 public void PreprocessStylusSystemGesture(StylusSystemGestureEventArgs e) { }
コード例 #9
0
		void IMouseProcessor2.PostprocessStylusSystemGesture(StylusSystemGestureEventArgs e) => MouseProcessor2?.PostprocessStylusSystemGesture(e);
コード例 #10
0
ファイル: StylusLogic.cs プロジェクト: sjyanxin/WPFSource
        void PromotePreviewToMain(ProcessInputEventArgs e) 
        { 
            if (!e.StagingItem.Input.Handled)
            { 
                RoutedEvent eventMain = GetMainEventFromPreviewEvent(e.StagingItem.Input.RoutedEvent);
                if (eventMain != null)
                {
                    StylusEventArgs eventArgsPreview = (StylusEventArgs)e.StagingItem.Input; 
                    StylusDevice stylusDevice = eventArgsPreview.InputReport.StylusDevice;
 
                    StylusEventArgs eventArgsMain; 
                    if (eventMain == Stylus.StylusDownEvent ||
                        eventMain == Stylus.PreviewStylusDownEvent) 
                    {
                        StylusDownEventArgs downEventArgsPreview = (StylusDownEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusDownEventArgs(stylusDevice, eventArgsPreview.Timestamp);
                    } 
                    else if (eventMain == Stylus.StylusButtonDownEvent ||
                        eventMain == Stylus.StylusButtonUpEvent) 
                    { 
                        StylusButtonEventArgs buttonEventArgsPreview = (StylusButtonEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusButtonEventArgs(stylusDevice, eventArgsPreview.Timestamp, buttonEventArgsPreview.StylusButton); 
                    }
                    else if (eventMain != Stylus.StylusSystemGestureEvent)
                    {
                        eventArgsMain = new StylusEventArgs(stylusDevice, eventArgsPreview.Timestamp); 
                    }
                    else 
                    { 
                        StylusSystemGestureEventArgs previewSystemGesture = (StylusSystemGestureEventArgs)eventArgsPreview;
                        eventArgsMain = new StylusSystemGestureEventArgs(stylusDevice, 
                                                                         previewSystemGesture.Timestamp,
                                                                         previewSystemGesture.SystemGesture,
                                                                         previewSystemGesture.GestureX,
                                                                         previewSystemGesture.GestureY, 
                                                                         previewSystemGesture.ButtonState);
                    } 
                    eventArgsMain.InputReport = eventArgsPreview.InputReport; 
                    eventArgsMain.RoutedEvent = eventMain;
                    e.PushInput(eventArgsMain, e.StagingItem); 
                }
            }
            else
            { 
                // A TouchDevice is activated before TouchDown and deactivated after TouchUp
                // But if PreviewStylusUp event is handled by the user, it will 
                // never be promoted to TouchUp event leaving the TouchDevice in inconsistent 
                // active state. Hence deactivating touch device if it is active.
                StylusEventArgs stylusEventArgs = e.StagingItem.Input as StylusEventArgs; 
                if (stylusEventArgs != null &&
                    stylusEventArgs.RoutedEvent == Stylus.PreviewStylusUpEvent &&
                    stylusEventArgs.StylusDevice.TouchDevice.IsActive)
                { 
                    stylusEventArgs.StylusDevice.TouchDevice.OnDeactivate();
                } 
            } 
        }
コード例 #11
0
ファイル: StylusLogic.cs プロジェクト: sjyanxin/WPFSource
 private bool IgnoreGestureToMousePromotion(StylusSystemGestureEventArgs gestureArgs, StylusTouchDevice touchDevice)
 { 
     if (gestureArgs != null && touchDevice.DownHandled)
     { 
         // If touchDevice's down event is already handled 
         // and if this gesture is a candidate for mouse
         // left button down promotion, then such a 
         // promotion should be ignored.
         SystemGesture gesture = gestureArgs.SystemGesture;
         if (gesture == SystemGesture.Tap ||
             gesture == SystemGesture.Drag) 
         {
             return true; 
         } 
     }
     return false; 
 }
コード例 #12
0
ファイル: StylusLogic.cs プロジェクト: sjyanxin/WPFSource
 void PromoteRawToPreview(RawStylusInputReport report, ProcessInputEventArgs e)
 {
     RoutedEvent routedEvent = GetPreviewEventFromRawStylusActions(report.Actions); 
     if (routedEvent != null && report.StylusDevice != null && !report.StylusDevice.IgnoreStroke)
     { 
         StylusEventArgs args; 
         if (routedEvent != Stylus.PreviewStylusSystemGestureEvent)
         { 
             if (routedEvent == Stylus.PreviewStylusDownEvent)
             {
                 args = new StylusDownEventArgs(report.StylusDevice, report.Timestamp);
             } 
             else
             { 
                 args = new StylusEventArgs(report.StylusDevice, report.Timestamp); 
              }
         } 
         else
         {
             RawStylusSystemGestureInputReport reportSg = (RawStylusSystemGestureInputReport)report;
             args = new StylusSystemGestureEventArgs(report.StylusDevice, 
                                                     report.Timestamp,
                                                     reportSg.SystemGesture, 
                                                     reportSg.GestureX, 
                                                     reportSg.GestureY,
                                                     reportSg.ButtonState); 
         }
         args.InputReport = report;
         args.RoutedEvent= routedEvent;
         e.PushInput(args, e.StagingItem); 
     }
 } 
コード例 #13
0
ファイル: InfoGrid.cs プロジェクト: DebugOfTheRoad/BigData
        void BackgroundGesture(object sender, StylusSystemGestureEventArgs args) {
            if (args.SystemGesture != SystemGesture.Tap) { return; }

            AnimateOut();
        }
コード例 #14
0
ファイル: InfoGrid.cs プロジェクト: DebugOfTheRoad/BigData
        void SendLabelGesture(object sender, StylusSystemGestureEventArgs args) {
            if (args.SystemGesture != SystemGesture.Tap) { return; }

            SendEMail();
            args.Handled = true;
        }
コード例 #15
0
ファイル: ContentElement.cs プロジェクト: alesliehughes/olive
		protected virtual void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
		{
			throw new NotImplementedException ();
		}
コード例 #16
0
ファイル: TouchTest.xaml.cs プロジェクト: jithuin/infogeezer
 private void cProbe_StylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
 {
     DisplayEvent("StylusSystemGesture", e.ToText());
 }
コード例 #17
0
 protected virtual void OnStylusSystemGesture(StylusSystemGestureEventArgs e);
コード例 #18
0
        void ImageTapped(object sender, StylusSystemGestureEventArgs args) {
            if (args.SystemGesture != SystemGesture.Tap) { return; }

            var publication = publications[(Image)sender];
            RaiseEvent(new PublicationSelectedArgs(
                PublicationCanvas.PublicationSelectedEvent, publication));
        }
コード例 #19
0
 private void DragSource_StylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
 {
     if (e.SystemGesture == SystemGesture.TwoFingerTap)
     {
         // cancel drag operation
         this.draggedData = null;
         //Console.WriteLine("mouse dbl click, cancel");
     }
 }
コード例 #20
0
ファイル: CustomInkCanvas.cs プロジェクト: rudi-c/htn-stylus
 protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
 {
     base.OnStylusSystemGesture(e);
 }
コード例 #21
0
        /// <summary>
        /// Invoked when an unhandled StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="T:System.Windows.Input.StylusSystemGestureEventArgs"/> that contains the event data.
        /// </param>
        protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
        {
            base.OnStylusSystemGesture(e);

            // Debug.WriteLine("OnStylusSystemGesture: " + e.SystemGesture);
            if (e.SystemGesture == SystemGesture.HoldEnter)
            {
                var p = e.GetPosition(this);
                this.changeLookAtHandler.Started(new ManipulationEventArgs(p));
                this.changeLookAtHandler.Completed(new ManipulationEventArgs(p));
                e.Handled = true;
            }

            if (e.SystemGesture == SystemGesture.TwoFingerTap)
            {
                this.ZoomExtents();
                e.Handled = true;
            }
        }
コード例 #22
0
ファイル: CustomInkCanvas.cs プロジェクト: rudi-c/htn-stylus
 void invoker_StylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
 {
     this.OnStylusSystemGesture(e);
 }
コード例 #23
0
        private static void OnStylusSystemGestureThunk(object sender, StylusSystemGestureEventArgs e)
        {
            Invariant.Assert(!e.Handled, "Unexpected: Event has already been handled.");

            UIElement uie = sender as UIElement;

            if (uie != null)
            {
                uie.OnStylusSystemGesture(e);
            }
            else
            {
                ContentElement ce = sender as ContentElement;

                if (ce != null)
                {
                    ce.OnStylusSystemGesture(e);
                }
                else
                {
                    ((UIElement3D)sender).OnStylusSystemGesture(e);
                }
            }
        }
コード例 #24
0
		/// <summary>
		/// Stylus system gesture postprocess handler
		/// </summary>
		/// <param name="e">Event args</param>
		public virtual void PostprocessStylusSystemGesture(StylusSystemGestureEventArgs e) { }
コード例 #25
0
 /// <summary>
 ///     Virtual method reporting a stylus system gesture
 /// </summary>
 protected internal virtual void OnStylusSystemGesture(StylusSystemGestureEventArgs e) {}
コード例 #26
0
 private void OnStylusSystemGestureEventArgs(object sender, StylusSystemGestureEventArgs e)
 {
     if (!IsSampling(sender))
     {
         return;
     }
     _itw.WriteLine(".RaiseStylusSystemGestureEvent({0})", e.RoutedEvent.OwnerType.Name + "." + e.RoutedEvent.Name + "Event");
     CodeBox.Text = _sw.ToString();
 }