Ejemplo n.º 1
0
        /// <summary>
        /// 从Cbl表的多个数据行生成电缆类集合的实例
        /// </summary>
        /// <param name="rowsEQACable">Cbl表</param>
        /// <returns></returns>
        public static EQACableCollection CreateEQACables(DataRow[] rowsEQACable)
        {
            if (rowsEQACable == null)
            {
                throw new System.ArgumentNullException("from function CreateEQACables", "Parameter rowsEQACable equals to null");
            }

            EQACableCollection cables = new EQACableCollection();

            if (rowsEQACable.Length <= 0)
            {
                return(cables);
            }

            lock (rowsEQACable)
            {
                try
                {
                    foreach (DataRow rowCable in rowsEQACable)
                    {
                        cables.Add(CreateEQACable(rowCable));
                    }
                }
                catch (DataException ex)
                {
                    MessageBoxWinForm.Info("数据访问错误", ex.Message, "");
                }
            }

            return(cables);
        }
Ejemplo n.º 2
0
 public EQASubSystem()
 {
     SubSystemID = "";
     Name        = "";
     _loops      = new EQALoopCollection();
     _cables     = new EQACableCollection();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Deep Clone
        /// </summary>
        /// <returns></returns>
        public EQACableCollection Copy()
        {
            EQACableCollection cables = new EQACableCollection();

            if (this.Count <= 0)
            {
                return(cables);
            }
            else
            {
                foreach (EQACable cable in this)
                {
                    cables.Add(cable.Copy());
                }
                return(cables);
            }
        }