private void TimerCallback(object state) { DateTime dt = DateTime.Now; for (int i = _values.Count - 1; i >= 0; i--) { ActionToken at = _values[i]; if (at != null) { if (!at.IsStateFinished) { if (at.CheckExpired(dt)) { _sessionClient.TokenExpired(at); } } else { _values.RemoveAt(i); } } } for (int i = _timeIntervals.Count - 1; i >= 0; i--) { TimeInterval ti = _timeIntervals[i]; if (ti != null) { if (ti.CheckExpired(dt)) { _sessionClient.HandleActionCase(ti); _timeIntervals.RemoveAt(i); } } } lock (mLockObject) { if (_timer != null) { _timer.Change(TICK, Timeout.Infinite); } } }