void PointerDeviceTypeDebugMessage(Windows.Devices.Input.PointerDeviceType types) { string deviceString = ""; foreach (Windows.Devices.Input.PointerDeviceType type in Enum.GetValues(typeof(Windows.Devices.Input.PointerDeviceType))) { if ((type & types) != 0) { deviceString += "[" + type + "]"; } } DebugMessage("Device: " + deviceString); }
public override Calculator GetCalculator(Windows.Devices.Input.PointerDeviceType deviceType) { switch (deviceType) { case Windows.Devices.Input.PointerDeviceType.Mouse: case Windows.Devices.Input.PointerDeviceType.Touch: return(CalculatorForMouseAndTouch); case Windows.Devices.Input.PointerDeviceType.Pen: return(CalculatorForStylus); default: throw new Exception("Unknown input device type"); } }
private PointerType ConvertPointerDeviceType(WinRTPointerDeviceType deviceType) { switch (deviceType) { case WinRTPointerDeviceType.Mouse: return(PointerType.Mouse); case WinRTPointerDeviceType.Pen: throw new NotSupportedException("Pen device input is not supported."); case WinRTPointerDeviceType.Touch: return(PointerType.Touch); } return(PointerType.Unknown); }
void PointerDeviceTypeDebugMessage(Windows.Devices.Input.PointerDeviceType types) { var deviceString = ""; foreach (Windows.Devices.Input.PointerDeviceType type in Enum.GetValues(typeof(Windows.Devices.Input.PointerDeviceType))) { if ((type & types) != 0) #pragma warning disable CC0039 // Don't concatenate strings in loops { deviceString += "[" + type + "]"; } #pragma warning restore CC0039 // Don't concatenate strings in loops } DebugMessage("Device: " + deviceString); }
public static PointerDeviceType ToRXDeviceType(this Windows.Devices.Input.PointerDeviceType self) { switch (self) { case Windows.Devices.Input.PointerDeviceType.Mouse: return(PointerDeviceType.Mouse); case Windows.Devices.Input.PointerDeviceType.Pen: return(PointerDeviceType.Pen); case Windows.Devices.Input.PointerDeviceType.Touch: return(PointerDeviceType.Touch); default: return((PointerDeviceType)self); } }
public override PathPointLayout GetLayout(Windows.Devices.Input.PointerDeviceType deviceType) { switch (deviceType) { case Windows.Devices.Input.PointerDeviceType.Mouse: case Windows.Devices.Input.PointerDeviceType.Touch: return(new PathPointLayout(PathPoint.Property.X, PathPoint.Property.Y, PathPoint.Property.Size, PathPoint.Property.Alpha)); case Windows.Devices.Input.PointerDeviceType.Pen: return(new PathPointLayout(PathPoint.Property.X, PathPoint.Property.Y, PathPoint.Property.Size, PathPoint.Property.Alpha, PathPoint.Property.Rotation, PathPoint.Property.OffsetX, PathPoint.Property.OffsetY)); default: throw new Exception("Unknown input device type"); } }
public abstract Calculator GetCalculator(Windows.Devices.Input.PointerDeviceType deviceType);
public abstract PathPointLayout GetLayout(Windows.Devices.Input.PointerDeviceType deviceType);
// Internal abstraction is used by the Unit Tests internal async Task InternalPointerPressedAsync(uint pointerId, Point position, Windows.Devices.Input.PointerDeviceType pointerDeviceType) { _pointerId = pointerId; PickStarted?.Invoke(this, EventArgs.Empty); await UpdateAppScreenshotAsync(); UpdateEyedropper(position); if (pointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch) { VisualStateManager.GoToState(this, TouchState, false); } else { VisualStateManager.GoToState(this, MousePenState, false); } if (Opacity < 1) { Opacity = 1; } }
private PointerType ConvertPointerDeviceType(WinRTPointerDeviceType deviceType) { switch (deviceType) { case WinRTPointerDeviceType.Mouse: return PointerType.Mouse; case WinRTPointerDeviceType.Pen: throw new NotSupportedException("Pen device input is not supported."); case WinRTPointerDeviceType.Touch: return PointerType.Touch; } return PointerType.Unknown; }