/// <summary>
        ///     Initializes a new instance of the InputEventArgs class.
        /// </summary>
        /// <param name="inputDevice">
        ///     The input device to associate with this event.
        /// </param>
        /// <param name="timestamp">
        ///     The time when the input occured.
        /// </param>
        public InputEventArgs(InputDevice inputDevice, DateTime timestamp)
        {
            /* inputDevice parameter being null is valid                */
            /* timestamp parameter is valuetype, need not be checked    */

            _inputDevice = inputDevice;
            Timestamp = timestamp;
        }
        /// <summary>
        ///     Initializes a new instance of the InputReportEventArgs class.
        /// </summary>
        /// <param name="inputDevice">
        ///     The input device to associate this input with.
        /// </param>
        /// <param name="report">
        ///     The input report being processed.
        /// </param>
        public InputReportEventArgs(InputDevice inputDevice,
                                    InputReport report)
            : base(inputDevice, ((report != null) ? report.Timestamp : DateTime.MinValue))
        {
            if (report == null)
                throw new ArgumentNullException("report");

            Report = report;
        }
        /// <summary>
        ///     Reports input to the input manager.
        /// </summary>
        /// <returns>
        ///     Whether or not any event generated as a consequence of this
        ///     event was handled.
        /// </returns>
        // do we really need this?  Make the "providers" call InputManager.ProcessInput themselves.
        // we currently need to map back to providers for other reasons.
        public bool ReportInput(InputDevice device, InputReport inputReport)
        {
            if (_isDisposed)
            {
                throw new InvalidOperationException();
            }

            bool handled = false;

            InputReportEventArgs input = new InputReportEventArgs(device, inputReport);
            input.RoutedEvent = InputManager.PreviewInputReportEvent;

            if (_inputManager != null)
            {
                handled = _inputManager.ProcessInput(input);
            }

            return handled;
        }
Beispiel #4
0
 // Methods
 public TouchEventArgs(InputDevice inputDevice, DateTime timestamp, TouchInput[] touches)
     : base(inputDevice, timestamp)
 {
     Touches = touches;
 }
 public GenericEventArgs(InputDevice inputDevice, GenericEvent genericEvent)
     : base(inputDevice, genericEvent.Time)
 {
     InternalEvent = genericEvent;
 }
Beispiel #6
0
 public GenericEventArgs(InputDevice inputDevice, GenericEvent genericEvent)
     : base(inputDevice, genericEvent.Time)
 {
     InternalEvent = genericEvent;
 }