12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using SysBaseLibs;
- namespace SysDataLibs
- {
- public class YTErrorList
- {
- private List<DateTime> _ErrorTimes = new List<DateTime>();
- public List<DateTime> ErrorTimes
- {
- get
- {
- return _ErrorTimes;
- }
- set
- {
- _ErrorTimes = value;
- }
- }
- public bool IsCanStop
- {
- get
- {
- bool lbRetval = false;
- try
- {
- if (ErrorTimes.Count > 20)
- {
- TimeSpan ts = Utils.DateDiff(ErrorTimes[ErrorTimes.Count - 1], ErrorTimes[ErrorTimes.Count - 20]);
- if (ts.Hours <= 2)
- {
- lbRetval = true;
- }
- for (int i = 0; i < ErrorTimes.Count - 20; i++)
- {
- ErrorTimes.RemoveAt(i);
- }
- }
- }
- catch
- {
- }
- return lbRetval;
- }
- }
- }
- }
|