Ejemplo n.º 1
0
        internal RawStylusSystemGestureInputReport(
            InputMode mode,
            int timestamp,
            PresentationSource inputSource,
            PenContext penContext,
            int tabletId,
            int stylusDeviceId,
            SystemGesture systemGesture,
            int gestureX,
            int gestureY,
            int buttonState)
            : base(mode, timestamp, inputSource,
                   penContext, RawStylusActions.SystemGesture,
                   tabletId, stylusDeviceId, new int[] {})
        {
            if (!RawStylusSystemGestureInputReport.IsValidSystemGesture(systemGesture, true, true))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "systemGesture"));
            }

            _id          = systemGesture;
            _gestureX    = gestureX;
            _gestureY    = gestureY;
            _buttonState = buttonState;
        }
Ejemplo n.º 2
0
        private void Initialize(SystemGesture systemGesture, int gestureX, int gestureY, int buttonState)
        {
            if (!RawStylusSystemGestureInputReport.IsValidSystemGesture(systemGesture, true, true))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, nameof(systemGesture)));
            }

            _id          = systemGesture;
            _gestureX    = gestureX;
            _gestureY    = gestureY;
            _buttonState = buttonState;
        }
        /////////////////////////////////////////////////////////////////////
        /// <summary>
        ///     Initializes a new instance of the StylusSystemGestureEventArgs class.
        /// </summary>
        /// <param name="stylusDevice">
        ///     The logical Stylus device associated with this event.
        /// </param>
        /// <param name="timestamp">
        ///     The time when the input occured.
        /// </param>
        /// <param name="systemGesture">
        ///     The type of system gesture.
        /// </param>
        public StylusSystemGestureEventArgs(
            StylusDevice stylusDevice, int timestamp,
            SystemGesture systemGesture) :
            base(stylusDevice, timestamp)
        {
            if (!RawStylusSystemGestureInputReport.IsValidSystemGesture(systemGesture, false, false))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "systemGesture"));
            }

            _id = systemGesture;
        }
        /////////////////////////////////////////////////////////////////////
        /// <summary>
        ///     Initializes a new instance of the StylusSystemGestureEventArgs class.
        /// </summary>
        /// <param name="stylusDevice">
        ///     The logical Stylus device associated with this event.
        /// </param>
        /// <param name="timestamp">
        ///     The time when the input occured.
        /// </param>
        /// <param name="systemGesture">
        ///     The type of system gesture.
        /// </param>
        /// <param name="gestureX">
        ///     The X location reported with this system gesture.  In tablet
        ///     device coordinates.
        /// </param>
        /// <param name="gestureY">
        ///     The Y location reported with this system gesture.  In tablet
        ///     device coordinates.
        /// </param>
        /// <param name="buttonState">
        ///     The button state at the time of the system gesture.
        ///     Note: A flick gesture will pass the flick data in the parameter.
        /// </param>
        internal StylusSystemGestureEventArgs(
            StylusDevice stylusDevice,
            int timestamp,
            SystemGesture systemGesture,
            int gestureX,
            int gestureY,
            int buttonState) :
            base(stylusDevice, timestamp)
        {
            if (!RawStylusSystemGestureInputReport.IsValidSystemGesture(systemGesture, true, false))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "systemGesture"));
            }

            _id          = systemGesture;
            _buttonState = buttonState;
            _gestureX    = gestureX;
            _gestureY    = gestureY;
        }