public static MonitorStateBusiness GetInstance() { if (_instance == null) { _instance = new MonitorStateBusiness(); } return(_instance); }
/// <summary> /// 初始化 /// </summary> /// <param name="lines"></param> public void Init(IEnumerable <LineModel> lines) { //Report += MonitorAlarmBusiness.GetInstance().WriteAlarmToDB; Report += MonitorStateBusiness.GetInstance().UpdateStateToDB; lock (_lock) { foreach (var collector in _collectors) { collector.Value.Collected -= OnCollected; } _collectors.Clear(); Add(lines); } }