1

我有一个多人使用的 WPF 应用程序,有时我会收到一封包含此错误的电子邮件,但我无法重现它。任何人都知道该怎么做才能得到这个错误?

at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Windows.Input.StylusLogic.PromoteStoredItemsToMouse(StylusTouchDevice touchDevice)
   at System.Windows.Input.StylusTouchDevice.OnManipulationEnded(Boolean cancel)
   at System.Windows.Input.TouchDevice.System.Windows.Input.IManipulator.ManipulationEnded(Boolean cancel)
   at System.Windows.Input.ManipulationDevice.OnManipulationCancel()
   at System.Windows.Input.ManipulationDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.ManipulationDevice.ProcessManipulationInput(InputEventArgs e)
   at System.Windows.Input.ManipulationLogic.ReportFrame(ICollection`1 manipulators)
   at System.Windows.Input.ManipulationDevice.ReportFrame()
   at System.Windows.Input.ManipulationDevice.RemoveManipulator(IManipulator manipulator)
   at System.Windows.Input.Manipulation.TryRemoveManipulator(UIElement element, IManipulator manipulator)
   at System.Windows.Input.TouchDevice.PromoteMainToManipulation(UIElement manipulatableElement, TouchEventArgs touchEventArgs)
   at System.Windows.Input.TouchDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.TouchDevice.RaiseLostCapture(IInputElement oldCapture)
   at System.Windows.Input.TouchDevice.Capture(IInputElement element, CaptureMode captureMode)
   at System.Windows.Input.TouchDevice.PromoteMainToManipulation(UIElement manipulatableElement, TouchEventArgs touchEventArgs)
   at System.Windows.Input.TouchDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.TouchDevice.RaiseTouchUp()
   at System.Windows.Input.TouchDevice.ReportUp()
   at System.Windows.Input.StylusLogic.PromoteMainUpToTouch(StylusDevice stylusDevice, StagingAreaInputItem stagingItem)
   at System.Windows.Input.StylusLogic.PromoteMainToTouch(ProcessInputEventArgs e, StylusEventArgs stylusEventArgs)
   at System.Windows.Input.StylusLogic.PromoteMainToOther(ProcessInputEventArgs e)
   at System.Windows.Input.StylusLogic.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Methode:             Void ThrowArgumentOutOfRangeException()
4

1 回答 1

0

鼠标输入工作正常,但 Touch 会导致此异常。在我的情况下,禁用 RealTimeStylus 似乎已经解决了这个特定问题。

请参阅http://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/Windows/Input/Stylus/StylusTouchDevice.cs

取自一个相关问题,该问题具有类似的堆栈跟踪,但由 RealTimeStylus 引起不同的异常。 https://stackoverflow.com/a/15879522/3304592

于 2015-03-19T22:54:52.250 回答