有人可以帮我停止计时器,直到方法“Utils.ItsTimeToRemind(remind.FormTag);” 完成了吗?然后重新开始...
public static Timer TIMER;
public TimerClass()
{
TimerCallback callback = new TimerCallback(Tick);
TIMER = new Timer(callback, null, 0, 1000);
}
static public void Tick(Object stateInfo)
{
List<RemindObject> remList = Utils.Reminds;
foreach (RemindObject remind in remList)
{
if (remind.reminTime.CompareTo(DateTime.Now) < 0)
{
Utils.ItsTimeToRemind(remind.FormTag);
}
}
}