ManipulationProcessor2D.ProcessManipulators 方法

定义

将指定的操控器作为单个批处理操作进行处理。

public:
 void ProcessManipulators(long timestamp, System::Collections::Generic::IEnumerable<System::Windows::Input::Manipulations::Manipulator2D> ^ manipulators);
public void ProcessManipulators(long timestamp, System.Collections.Generic.IEnumerable<System.Windows.Input.Manipulations.Manipulator2D> manipulators);
member this.ProcessManipulators : int64 * seq<System.Windows.Input.Manipulations.Manipulator2D> -> unit
Public Sub ProcessManipulators (timestamp As Long, manipulators As IEnumerable(Of Manipulator2D))

参数

timestamp
Int64

批的时间戳,以 100 纳秒的刻度为单位。

manipulators
IEnumerable<Manipulator2D>

当前处于范围内的操纵器集。

例外

时间戳小于当前操作的上一个时间戳。

示例

在下面的示例中, OnLostMouseCapture 将重写对象的方法 UIElement ,以调用 ProcessManipulators 对象列表 Manipulator2D 设置为 null 的方法。

#region OnLostMouseCapture
protected override void OnLostMouseCapture(MouseEventArgs e)
{
    base.OnLostMouseCapture(e);
    manipulationProcessor.ProcessManipulators(Timestamp, null);
}
#endregion
#region Timestamp
private long Timestamp
{
    get
    {
        // Get timestamp in 100-nanosecond units.
        double nanosecondsPerTick = 1000000000.0 / System.Diagnostics.Stopwatch.Frequency;
        return (long)(System.Diagnostics.Stopwatch.GetTimestamp() / nanosecondsPerTick / 100.0);
    }
}
#endregion

注解

该参数 manipulators 可以是空列表或 null。 如果这会导致操作器数达到零,则会 Completed 引发该事件。

适用于