示例#1
0
        public AlarmManage(AlarmFormStyle style)
        {
            docAlarm         = null;
            _objLock         = new object();
            _dicCurrAlarmMsg = new Dictionary <string, AlarmData>();

            _alarmFormStyle = style;
            if (style == AlarmFormStyle.CatlStyle)
            {
                _formAlarmCatl          = new FormAlarmCatl();
                _formAlarmCatl.TopLevel = true;
                _formAlarmCatl.TopMost  = true;
            }
            else
            {
                _formAlarm          = new FormAlarm();
                _formAlarm.TopLevel = true;
                _formAlarm.TopMost  = true;
            }

            formAlarmManage = new FormAlarmManage();
            StartScan();
        }
示例#2
0
        public static AlarmDoc LoadDoc()
        {
            AlarmDoc      alarmDoc;
            XmlSerializer xml = new XmlSerializer(typeof(AlarmDoc));
            FileStream    fs  = null;

            try
            {
                fs       = File.OpenRead(@".//Parameter/Alarm Manage/AlarmDoc" + ".xml");
                alarmDoc = (AlarmDoc)xml.Deserialize(fs);
                fs.Close();
                alarmDoc.dicAlarmItems = alarmDoc.listAlarmItems.ToDictionary(p => p.AlarmKey);
            }
            catch (Exception)
            {
                if (null != fs)
                {
                    fs.Close();
                }
                alarmDoc = new AlarmDoc();
            }

            return(alarmDoc);
        }
示例#3
0
 public void LoadDoc()
 {
     docAlarm = AlarmDoc.LoadDoc();
 }