public void SaveDataThreshold(string screenSN, DataThresholdInfo dataThreshold)
        {
            if (IsAllScreen(screenSN))
            {
                foreach (string key in MonitorConfig.AllDataThresholdDic.Keys)
                {
                    MonitorConfig.AllDataThresholdDic[key] = (DataThresholdInfo)dataThreshold.Clone();
                    //写入库
                }
                if (MonitorConfig.MonitorUIConfig.IsDataThresholdSame == false)
                {
                    MonitorConfig.MonitorUIConfig.IsDataThresholdSame = true;
                    SaveMonitorUIDisplayConfig(MonitorConfig.MonitorUIConfig);
                }
            }
            else
            {
                if (MonitorConfig.MonitorUIConfig.IsDataThresholdSame == true)
                {
                    MonitorConfig.MonitorUIConfig.IsDataThresholdSame = false;
                    SaveMonitorUIDisplayConfig(MonitorConfig.MonitorUIConfig);
                }

                MonitorConfig.AllDataThresholdDic[screenSN] = (DataThresholdInfo)dataThreshold.Clone();
                //写入库
            }
        }
Example #2
0
        public object Clone()
        {
            DataThresholdInfo newObj = new DataThresholdInfo();
            bool res = this.CopyTo(newObj);

            if (!res)
            {
                return(null);
            }
            else
            {
                return(newObj);
            }
        }
Example #3
0
        public bool CopyTo(object obj)
        {
            if (!(obj is DataThresholdInfo))
            {
                return(false);
            }
            DataThresholdInfo temp = (DataThresholdInfo)obj;

            temp.FirstSenderSN        = this.FirstSenderSN;
            temp.TemperatureThreshold = this.TemperatureThreshold;
            temp.VoltageThreshold     = this.VoltageThreshold;
            temp.HumidityThreshold    = this.HumidityThreshold;
            temp.FanSpeedThreshold    = this.FanSpeedThreshold;

            return(true);
        }