當前位置: 首頁>>代碼示例>>C#>>正文


C# Core.PointerEventArgs類代碼示例

本文整理匯總了C#中Windows.UI.Core.PointerEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# PointerEventArgs類的具體用法?C# PointerEventArgs怎麽用?C# PointerEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PointerEventArgs類屬於Windows.UI.Core命名空間,在下文中一共展示了PointerEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: StrokeInput_StrokeStarted

 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     ClearSelection();
     inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
     inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
     inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
 }
開發者ID:polarapfel,項目名稱:Windows-universal-samples,代碼行數:7,代碼來源:Scenario2.xaml.cs

示例2: OnPointerReleased

 private void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
 {
     if (this.PointerReleased != null)
     {
         this.PointerReleased(sender, args);
     }
 }
開發者ID:r2d2rigo,項目名稱:SharpDX.SimpleInitializer,代碼行數:7,代碼來源:SharpDXContext.cs

示例3: pointerMoved

		private void pointerMoved(CoreWindow sender, PointerEventArgs e)
		{
			theEvent.Type = ApplicationEventTypes.MouseMove;
			var loc = e.CurrentPoint.RawPosition;
			theEvent.CursorPosition = new Point2((int)loc.X, (int)loc.Y);
			handleEvent(theEvent);
		}
開發者ID:reignstudios,項目名稱:ReignSDK,代碼行數:7,代碼來源:CoreMetroWindow.cs

示例4: OnPointerMoved

 void OnPointerMoved(CoreWindow sender, PointerEventArgs args)
 {
     try
     {
         gestureRecognizer.ProcessMoveEvents(args.GetIntermediatePoints());
     }
     catch (System.Exception e)
     {
         System.Diagnostics.Debug.WriteLine("Lets do the time warp again.");
     }
 }
開發者ID:Nantangitan,項目名稱:GI-PJ2,代碼行數:11,代碼來源:GameInput.cs

示例5: OnPointerReleased

 void OnPointerReleased(CoreWindow sender, PointerEventArgs args)
 {
     try
     {
         gestureRecognizer.ProcessUpEvent(args.CurrentPoint);
     }
     catch (System.Exception e)
     {
         System.Diagnostics.Debug.WriteLine("Let's do yet another time warp.");
     }
 }
開發者ID:Nantangitan,項目名稱:GI-PJ2,代碼行數:11,代碼來源:GameInput.cs

示例6: PointerMoved

 void PointerMoved(CoreWindow sender, PointerEventArgs args)
 {
     if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse)
     {
         var tmp = args.CurrentPoint.RawPosition;
         var dx = tmp.X - buffer.X;
         var dy = tmp.Y - buffer.Y;
         Distance += Math.Sqrt(dx * dx + dy * dy);
         buffer = tmp;
     }
 }
開發者ID:modulexcite,項目名稱:CodeSharing,代碼行數:11,代碼來源:MouseTracker.Metro.cs

示例7: Page_PointerPressed

 //Used to check if the pointer is within the bounds of the edit control.
 //If it is, focus should go to the edit control.  If it is outside the bounds
 //Focus should not be in the edit control.
 private void Page_PointerPressed(CoreWindow sender, PointerEventArgs args)
 {
     Rect _boundingbox = EditControl.GetLayout();
     if (_boundingbox.Contains(args.CurrentPoint.Position))
     {
         _textEditContext.InternalSetFocus();
         EditControl.Focus(FocusState.Programmatic);
     }
     else
     {
         _textEditContext.InternalRemoveFocus();
     }
 }
開發者ID:huoxudong125,項目名稱:Windows-universal-samples,代碼行數:16,代碼來源:Scenario1_Input.xaml.cs

示例8: UpdateIntermediatePoints

 void UpdateIntermediatePoints(PointerEventArgs args)
 {
     foreach (var point in args.GetIntermediatePoints())
     {
         if (point.IsInContact)
         {
             currentPointsInContact[point.PointerId] = point.Position;
         }
         else
         {
             currentPointsInContact.Remove(point.PointerId);
         }
     }
 }
開發者ID:fengweijp,項目名稱:Win2D,代碼行數:14,代碼來源:Renderer.cs

示例9: CoreWindow_PointerPressed

        /// <summary>
        /// Invoked on every mouse click, touch screen tap, or equivalent interaction when this
        /// page is active and occupies the entire window.  Used to detect browser-style next and
        /// previous mouse button clicks to navigate between pages.
        /// </summary>
        /// <param name="sender">Instance that triggered the event.</param>
        /// <param name="e">Event data describing the conditions that led to the event.</param>
        private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e)
        {
            var properties = e.CurrentPoint.Properties;

            // Ignore button chords with the left, right, and middle buttons
            if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
                properties.IsMiddleButtonPressed)
                return;

            // If back or foward are pressed (but not both) navigate appropriately
            bool backPressed = properties.IsXButton1Pressed;
            bool forwardPressed = properties.IsXButton2Pressed;
            if (backPressed ^ forwardPressed)
            {
                e.Handled = true;
                if (backPressed) RaisePointerGoBackGestured();
                if (forwardPressed) RaisePointerGoForwardGestured();
            }
        }
開發者ID:Rasetech,項目名稱:Template10,代碼行數:26,代碼來源:KeyboardHelper.cs

示例10: OnPointerPressed

        //------------------------------------------------------------------------------
        //
        // VisualProperties.OnPointerPressed
        //
        // This method is called when the user touches the screen, taps it with a stylus
        // or clicks the mouse.
        //
        //------------------------------------------------------------------------------

        void OnPointerPressed(CoreWindow window, PointerEventArgs args)
        {
            Point position = args.CurrentPoint.Position;

            //
            // Walk our list of visuals to determine who, if anybody, was selected
            //
            foreach (var child in _root.Children)
            {
                //
                // Did we hit this child?
                //
                Vector3 offset = child.Offset;
                Vector2 size = child.Size;

                if ((position.X >= offset.X) &&
                    (position.X < offset.X + size.X) &&
                    (position.Y >= offset.Y) &&
                    (position.Y < offset.Y + size.Y))
                {
                    //
                    // This child was hit. Since the children are stored back to front,
                    // the last one hit is the front-most one so it wins
                    //
                    _currentVisual = child as ContainerVisual;
                    _offsetBias = new Vector2((float)(offset.X - position.X),
                                              (float)(offset.Y - position.Y));
                }
            }

            //
            // If a visual was hit, bring it to the front of the Z order
            //
            if (_currentVisual != null)
            {
                ContainerVisual parent = _currentVisual.Parent as ContainerVisual;
                parent.Children.Remove(_currentVisual);
                parent.Children.InsertAtTop(_currentVisual);
            }
        }
開發者ID:RudyChen,項目名稱:composition,代碼行數:49,代碼來源:VisualProperties.cs

示例11: pointerPressed

		private void pointerPressed(CoreWindow sender, PointerEventArgs e)
		{
			if (e.CurrentPoint.Properties.IsLeftButtonPressed)
			{
				theEvent.Type = ApplicationEventTypes.LeftMouseDown;
				leftPointerOn = true;
			}
			else if (e.CurrentPoint.Properties.IsMiddleButtonPressed)
			{
				theEvent.Type = ApplicationEventTypes.MiddleMouseDown;
				middlePointerOn = true;
			}
			else if (e.CurrentPoint.Properties.IsRightButtonPressed)
			{
				theEvent.Type = ApplicationEventTypes.RightMouseDown;
				rightPointerOn = true;
			}
			
			var loc = e.CurrentPoint.RawPosition;
			theEvent.CursorPosition = new Point2((int)loc.X, (int)loc.Y);
			handleEvent(theEvent);
		}
開發者ID:reignstudios,項目名稱:ReignSDK,代碼行數:22,代碼來源:CoreMetroWindow.cs

示例12: CoreWindow_PointerPressed

        /// <summary>
        /// Se invoca en cada clic del mouse, punteo en la pantalla táctil o una interacción equivalente cuando esta
        /// página está activa y ocupa toda la ventana.  Se usa para detectar los clics de botón del mouse
        /// siguiente y anterior del estilo del explorador para navegar entre páginas.
        /// </summary>
        /// <param name="sender">Instancia que desencadena el evento.</param>
        /// <param name="e">Datos de evento que describen las condiciones que dan lugar al evento.</param>
        private void CoreWindow_PointerPressed(CoreWindow sender,
            PointerEventArgs e)
        {
            var properties = e.CurrentPoint.Properties;

            // Omitir la presión simultánea de botones con los botones Izquierda, Derecha y Medio
            if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
                properties.IsMiddleButtonPressed) return;

            // Si se presiona Repág o Avpág (pero no ambos), navegar adecuadamente
            bool backPressed = properties.IsXButton1Pressed;
            bool forwardPressed = properties.IsXButton2Pressed;
            if (backPressed ^ forwardPressed)
            {
                e.Handled = true;
                if (backPressed) this.GoBackCommand.Execute(null);
                if (forwardPressed) this.GoForwardCommand.Execute(null);
            }
        }
開發者ID:CristianJaramillo,項目名稱:FocusTest,代碼行數:26,代碼來源:NavigationHelper.cs

示例13: OnCoreWindowPointerReleased

        private void OnCoreWindowPointerReleased(CoreWindow sender, PointerEventArgs args)
        {
            if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse &&
                !args.CurrentPoint.Properties.IsLeftButtonPressed &&
                !args.CurrentPoint.Properties.IsMiddleButtonPressed &&
                _rightMouseButtonPressed)
            {
                OnSwitchGesture();
                args.Handled = true;
            }

            _rightMouseButtonPressed = false;
        } 
開發者ID:prabaprakash,項目名稱:Visual-Studio-2013,代碼行數:13,代碼來源:CustomAppBar.cs

示例14: OnCoreWindowPointerPressed

        private void OnCoreWindowPointerPressed(CoreWindow sender, PointerEventArgs args)
        {
            if (this.IsLightDismissEnabled &&
                this.CanDismiss && 
                this.IsOpen &&
                Window.Current != null &&
                Window.Current.Content != null)
            {
                var windowToAppBarTransform = Window.Current.Content.TransformToVisual(this);
                var appBarPosition = windowToAppBarTransform.TransformPoint(args.CurrentPoint.Position);
                var appBarBounds = this.GetBoundingRect(this);

                if (!appBarBounds.Contains(appBarPosition))
                {
                    this.IsOpen = false;
                    return;
                }
            }

            if (args.CurrentPoint.PointerDevice.PointerDeviceType == PointerDeviceType.Mouse)
            {
                _rightMouseButtonPressed =
                    args.CurrentPoint.Properties.IsRightButtonPressed &&
                    !args.CurrentPoint.Properties.IsLeftButtonPressed &&
                    !args.CurrentPoint.Properties.IsMiddleButtonPressed;

                if (_rightMouseButtonPressed)
                {
                    args.Handled = true;
                }
            }
        } 
開發者ID:prabaprakash,項目名稱:Visual-Studio-2013,代碼行數:32,代碼來源:CustomAppBar.cs

示例15: OnPointerPressed

 // Call the gesture recognizer when a pointer event occurs
 void OnPointerPressed(CoreWindow sender, PointerEventArgs args)
 {
     gestureRecognizer.ProcessDownEvent(args.CurrentPoint);
 }
開發者ID:georgecai904,項目名稱:mazeball,代碼行數:5,代碼來源:GameInput.cs


注:本文中的Windows.UI.Core.PointerEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。