/// <summary> /// Constructs an instance of the RawStylusInputReport class. /// </summary> /// <param name="mode"> /// The mode in which the input is being provided. /// </param> /// <param name="timestamp"> /// The time when the input occurred. /// </param> /// <param name="inputSource"> /// The PresentationSource over which the stylus moved. /// <param name="actions"> /// The set of actions being reported. /// </param> /// /// </param> /// <param name="stylusPointDescGenerator"> /// Function to generate the stylus point description. /// </param> /// <param name="tabletDeviceId"> /// Tablet device id. /// </param> /// <param name="stylusDeviceId"> /// Stylus device id. /// </param> /// <param name="data"> /// Raw stylus data. /// </param> internal RawStylusInputReport( InputMode mode, int timestamp, PresentationSource inputSource, RawStylusActions actions, Func <StylusPointDescription> stylusPointDescGenerator, int tabletDeviceId, int stylusDeviceId, int[] data) : base(inputSource, InputType.Stylus, mode, timestamp) { // Validate parameters if (!RawStylusActionsHelper.IsValid(actions)) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, nameof(actions))); } if (data == null && actions != RawStylusActions.InRange) { throw new ArgumentNullException(nameof(data)); } _actions = actions; _stylusPointDescGenerator = stylusPointDescGenerator; _data = data; _isSynchronize = false; _tabletDeviceId = tabletDeviceId; _stylusDeviceId = stylusDeviceId; }
internal RawStylusInputReport( InputMode mode, int timestamp, PresentationSource inputSource, PenContext penContext, RawStylusActions actions, int tabletDeviceId, int stylusDeviceId, int[] data) : base(inputSource, InputType.Stylus, mode, timestamp) { // Validate parameters if (!RawStylusActionsHelper.IsValid(actions)) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "actions")); } if (data == null && actions != RawStylusActions.InRange) { throw new ArgumentNullException("data"); } _penContext = new SecurityCriticalDataClass <PenContext>(penContext); _actions = actions; _tabletDeviceId = tabletDeviceId; _stylusDeviceId = stylusDeviceId; _data = data; _isSynchronize = false; }
/// <summary> /// Constructs an instance of the RawStylusInputReport class. /// </summary> /// <param name="mode"> /// The mode in which the input is being provided. /// </param> /// <param name="timestamp"> /// The time when the input occurred. /// </param> /// <param name="inputSource"> /// The PresentationSource over which the stylus moved. /// </param> /// <param name="penContext"> /// The PenContext. /// </param> /// <param name="actions"> /// The set of actions being reported. /// </param> /// <param name="tabletDeviceId"> /// Tablet device id. /// </param> /// <param name="stylusDeviceId"> /// Stylus device id. /// </param> /// <param name="data"> /// Raw stylus data. /// </param> internal RawStylusInputReport( InputMode mode, int timestamp, PresentationSource inputSource, PenContext penContext, RawStylusActions actions, int tabletDeviceId, int stylusDeviceId, int[] data) : this(mode, timestamp, inputSource, actions, () => { return(penContext.StylusPointDescription); }, tabletDeviceId, stylusDeviceId, data) { // Validate parameters if (!RawStylusActionsHelper.IsValid(actions)) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, nameof(actions))); } if (data == null && actions != RawStylusActions.InRange) { throw new ArgumentNullException(nameof(data)); } _actions = actions; _data = data; _isSynchronize = false; _tabletDeviceId = tabletDeviceId; _stylusDeviceId = stylusDeviceId; PenContext = penContext; }
internal RawStylusInputReport( InputMode mode, int timestamp, PresentationSource inputSource, RawStylusActions actions, StylusPointDescription mousePointDescription, int[] mouseData) : base(inputSource, InputType.Stylus, mode, timestamp) { // Validate parameters if (!RawStylusActionsHelper.IsValid(actions)) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "actions")); } if (mouseData == null) { throw new ArgumentNullException("mouseData"); } _penContext = new SecurityCriticalDataClass <PenContext>(null); _actions = actions; _tabletDeviceId = 0; _stylusDeviceId = 0; _data = mouseData; _isSynchronize = false; _mousePointDescription = mousePointDescription; _isMouseInput = true; }