共用方式為


InertiaProcessor2D.Complete(Int64) 方法

定義

使用指定的時間戳記完成最終的外推,並引發 Completed 事件。

public:
 void Complete(long timestamp);
public void Complete (long timestamp);
member this.Complete : int64 -> unit
Public Sub Complete (timestamp As Long)

參數

timestamp
Int64

完成外推的時間戳記 (以 100 奈秒為單位)。

例外狀況

時間戳記參數小於初始或上一個時間戳記。

範例

在下列範例中,事件的事件處理常式 ManipulationProcessor2D.Started 會檢查是否正在執行慣性處理,如果是,則會藉由呼叫 Complete 方法來停止它。

#region OnManipulationStarted
private void OnManipulationStarted(object sender, Manipulation2DStartedEventArgs e)
{
    if (inertiaProcessor.IsRunning)
    {
        inertiaProcessor.Complete(Timestamp);
    }
}
#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

備註

時間戳記以 100 奈秒為單位。

適用於