private void Excute(object sender, ElapsedEventArgs e) { if (_cancel) { return; } Timer t = (Timer)sender; try { _running = true; DispatcherExcute(); } catch (Exception ex) { FileLog.LogException("DispatcherService", "派班中心执行异常", ex); } finally { //设置标志位 _running = false; if (!_cancel) { //如果取消了 则不需要重新启动定时器 t.Enabled = true; } } }
private static void ExceptionLog(string content, Exception ex) { FileLog.LogException("DispatcherService", content, ex); }
private static void ExceptionLog(string content, Exception ex) { FileLog.LogException(LogFileName, content, ex); }