//每隔1秒监听一次 private void watch_Timer_Elapsed(object sender, EventArgs e) { Thread.CurrentThread.IsBackground = true; BathDBDataContext dc = new BathDBDataContext(connectionString); if (dc.PayMsg.Count() != 0) { watch_Timer.Interval = ts.Seconds * 1000; PayMsg msg = dc.PayMsg.ToList().Last(); string path = dir + GeneralClass.Now.ToShortDateString() + "\\" + msg.systemId + ".avi"; recording = true; video.StartKinescope(path); recordTime = GeneralClass.Now; dc.PayMsg.DeleteAllOnSubmit(dc.PayMsg.ToArray()); dc.SubmitChanges(); } if (recording && GeneralClass.Now - recordTime >= ts) { watch_Timer.Interval = 100; recording = false; video.StopKinescope(); } }
partial void DeletePayMsg(PayMsg instance);
partial void UpdatePayMsg(PayMsg instance);
partial void InsertPayMsg(PayMsg instance);