コード例 #1
0
 private void OnManipulationHostPointerMoved(DrawingSurfaceManipulationHost sender, Windows.UI.Core.PointerEventArgs args)
 {
     if (m_surfacePainter == null)
     {
         return;
     }
 }
コード例 #2
0
 private void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
 {
     if (this.PointerReleased != null)
     {
         this.PointerReleased(sender, args);
     }
 }
 /// <summary>
 /// Sets the manipulation host.
 /// </summary>
 /// <param name="manipulationHost">Manipulation host object.</param>
 public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
 {
     if (this.ManipulationHostChanged != null)
     {
         this.ManipulationHostChanged(this, manipulationHost);
     }
 }
コード例 #4
0
ファイル: XamlGame.cs プロジェクト: Damian666/blasters
            private static void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
            {
                var pointerPoint = args.CurrentPoint;

                // To convert from DIPs (device independent pixels) to screen resolution pixels.
                var dipFactor = DisplayProperties.LogicalDpi / 96.0f;
                var pos       = new Vector2((float)pointerPoint.Position.X, (float)pointerPoint.Position.Y) * dipFactor;

                TouchPanel.AddEvent((int)pointerPoint.PointerId, TouchLocationState.Released, pos);
            }
コード例 #5
0
ファイル: PointerPlatformWP8.cs プロジェクト: tomba/Toolkit
        /// <summary>
        /// Binds to the following events:
        ///  <see cref="DrawingSurfaceManipulationHost.PointerMoved"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerPressed"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerReleased"/>
        /// </summary>
        /// <param name="manipulationHost">An instance of <see cref="DrawingSurfaceManipulationHost"/>.</param>
        /// <exception cref="ArgumentNullException">Is thrown if <paramref name="manipulationHost"/> is null.</exception>
        void IDrawingSurfaceManipulationHandler.SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (manipulationHost == null)
            {
                throw new ArgumentNullException("manipulationHost");
            }

            manipulationHost.PointerMoved    += (_, e) => CreateAndAddPoint(PointerEventType.Moved, e.CurrentPoint);
            manipulationHost.PointerPressed  += (_, e) => CreateAndAddPoint(PointerEventType.Pressed, e.CurrentPoint);
            manipulationHost.PointerReleased += (_, e) => CreateAndAddPoint(PointerEventType.Released, e.CurrentPoint);
        }
コード例 #6
0
        /// <summary>
        /// Wird aufgerufen, wenn der Bearbeitungshandler für ein DrawingSurface- oder DrawingSurfaceBackgroundGrid-Steuerelement festgelegt wird.
        /// </summary>
        /// <param name="manipulationHost">Das Objekt, das die Bearbeitungsereignisse von der Zeichenoberfläche empfängt.</param>
        public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (m_surfacePainter == null)
            {
                return;
            }

            if (m_manipulationHost != null)
            {
                m_manipulationHost.PointerMoved    -= OnManipulationHostPointerMoved;
                m_manipulationHost.PointerPressed  -= OnManipulationHostPointerPressed;
                m_manipulationHost.PointerReleased -= OnManipulationHostPointerReleased;
            }
            m_manipulationHost = manipulationHost;
            if (m_manipulationHost != null)
            {
                m_manipulationHost.PointerMoved    += OnManipulationHostPointerMoved;
                m_manipulationHost.PointerPressed  += OnManipulationHostPointerPressed;
                m_manipulationHost.PointerReleased += OnManipulationHostPointerReleased;
            }
        }
コード例 #7
0
        /// <summary>
        /// Binds to the following events:
        ///  <see cref="DrawingSurfaceManipulationHost.PointerMoved"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerPressed"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerReleased"/>
        /// </summary>
        /// <param name="manipulationHost">An instance of <see cref="DrawingSurfaceManipulationHost"/>.</param>
        /// <exception cref="ArgumentNullException">Is thrown if <paramref name="manipulationHost"/> is null.</exception>
        void IDrawingSurfaceManipulationHandler.SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (manipulationHost == null) throw new ArgumentNullException("manipulationHost");

            manipulationHost.PointerMoved += (_, e) => CreateAndAddPoint(PointerEventType.Moved, e.CurrentPoint);
            manipulationHost.PointerPressed += (_, e) => CreateAndAddPoint(PointerEventType.Pressed, e.CurrentPoint);
            manipulationHost.PointerReleased += (_, e) => CreateAndAddPoint(PointerEventType.Released, e.CurrentPoint);
        }
コード例 #8
0
ファイル: XamlGame.cs プロジェクト: Damian666/blasters
 public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
 {
     manipulationHost.PointerPressed  += OnPointerPressed;
     manipulationHost.PointerMoved    += OnPointerMoved;
     manipulationHost.PointerReleased += OnPointerReleased;
 }
コード例 #9
0
 private void OnManipulationHostChanged(object sender, DrawingSurfaceManipulationHost host)
 {
     host.PointerPressed += this.OnPointerPressed;
     host.PointerMoved += this.OnPointerMoved;
     host.PointerReleased += this.OnPointerReleased;
 }