/// <summary> /// 从Loop表的多个数据行和Eqp表生成回路类集合的实例 /// </summary> /// <param name="tableLoop"></param> /// <param name="tableEQAEquipment"></param> /// <returns></returns> public static EQALoopCollection CreateEQALoops(DataRow[] rowsEQALoop, DataTable tableEQAEquipment) { if (rowsEQALoop == null) { throw new System.ArgumentNullException("from function CreateEQALoops", "Parameter tableEQALoop equals to null"); } if (tableEQAEquipment == null) { throw new System.ArgumentNullException("from function CreateEQALoops", "Parameter tableEQAEquipment equals to null"); } EQALoopCollection loops = new EQALoopCollection(); if (rowsEQALoop.Length <= 0) { return(loops); } lock (rowsEQALoop) { lock (tableEQAEquipment) { try { foreach (DataRow rowLoop in rowsEQALoop) { loops.Add(CreateEQALoop(rowLoop, tableEQAEquipment)); } } catch (DataException ex) { MessageBoxWinForm.Info("数据访问错误", ex.Message, ""); } } } return(loops); }
public EQASubSystem() { SubSystemID = ""; Name = ""; _loops = new EQALoopCollection(); _cables = new EQACableCollection(); }
/// <summary> /// Deep Clone /// </summary> /// <returns></returns> public EQALoopCollection Copy() { EQALoopCollection loops = new EQALoopCollection(); if (this.Count <= 0) { return(loops); } else { foreach (EQALoop loop in this) { loops.Add(loop.Copy()); } return(loops); } }