示例#1
0
        public bool CopyTo(object obj)
        {
            if (!(obj is MonitorSysData))
            {
                return(false);
            }
            MonitorSysData temp = (MonitorSysData)obj;

            temp.IsConfigInfoSame   = this.IsConfigInfoSame;
            temp.IsCycleMonitor     = this.IsCycleMonitor;
            temp.RetryReadTimes     = this.RetryReadTimes;
            temp.MonitorPeriod      = this.MonitorPeriod;
            temp.SameMonitorSysData = (OneDisplayMonitorSysData)this.SameMonitorSysData.Clone();
            if (this.AllDisplayMonitorSysDataList == null)
            {
                temp.AllDisplayMonitorSysDataList = null;
            }
            else
            {
                temp.AllDisplayMonitorSysDataList = new List <OneDisplayMonitorSysData>();
                for (int i = 0; i < this.AllDisplayMonitorSysDataList.Count; i++)
                {
                    temp.AllDisplayMonitorSysDataList.Add((OneDisplayMonitorSysData)this.AllDisplayMonitorSysDataList[i].Clone());
                }
            }
            return(true);
        }
示例#2
0
 public object Clone()
 {
     MonitorSysData newObj = new MonitorSysData();
     bool res = this.CopyTo(newObj);
     if (!res)
     {
         return null;
     }
     else
     {
         return newObj;
     }
 }
示例#3
0
        public object Clone()
        {
            MonitorSysData newObj = new MonitorSysData();
            bool           res    = this.CopyTo(newObj);

            if (!res)
            {
                return(null);
            }
            else
            {
                return(newObj);
            }
        }