The _dispatcherTimer
must be defined before the Tick
delegate, but needs not be started until after timerDelegate
is created.
Timer _dispatcherTimer = null;
TimerCallback timerDelegate = new TimerCallback(Tick);
_dispatcherTimer = new Timer(timerDelegate, null, period, period);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…