示例#1
0
 public static MonitorStateBusiness GetInstance()
 {
     if (_instance == null)
     {
         _instance = new MonitorStateBusiness();
     }
     return(_instance);
 }
示例#2
0
        /// <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);
            }
        }