当我使用System.Threading.Timer时,我可以停止我的计时器并重新启动它:
protected override void OnScrollChanged(int l, int t, int oldl, int oldt)
{
if (timer == null)
{
System.Threading.TimerCallback tcb = OnScrollFinished;
timer = new System.Threading.Timer(tcb, null, 700, System.Threading.Timeout.Infinite);
}
else
{
timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
timer.Change(700, System.Threading.Timeout.Infinite);
}
}
什么是停止Device.StartTimer并重新启动它的最佳方法?