/// <summary> /// Конструктор /// </summary> public Srez(DateTime dateTime, int cnlCnt) : base(dateTime, cnlCnt) { SrezDescr = new SrezDescr(cnlCnt); State = DataRowState.Detached; Position = -1; }
/// <summary> /// Копировать данные из исходного среза в текущий /// </summary> public void CopyDataFrom(SrezTableLight.Srez srcSrez) { if (srcSrez != null) { if (SrezDescr.Equals(srcSrez.CnlNums)) { srcSrez.CnlData.CopyTo(CnlData, 0); } else { int srcCnlCnt = srcSrez.CnlData.Length; for (int i = 0; i < srcCnlCnt; i++) { SetCnlData(srcSrez.CnlNums[i], srcSrez.CnlData[i]); } } } }
/// <summary> /// Конструктор /// </summary> public Srez(DateTime dateTime, SrezDescr srezDescr) { if (srezDescr == null) { throw new ArgumentNullException("srezDescr"); } DateTime = dateTime; int cnlCnt = srezDescr.CnlNums.Length; CnlNums = new int[cnlCnt]; srezDescr.CnlNums.CopyTo(CnlNums, 0); CnlData = new CnlData[cnlCnt]; SrezDescr = srezDescr; State = DataRowState.Detached; Position = -1; }
/// <summary> /// Проверить, идентичен ли заданный объект текущему /// </summary> public bool Equals(SrezDescr srezDescr) { if (srezDescr == this) { return true; } else if (srezDescr != null && CS == srezDescr.CS && CnlNums.Length == srezDescr.CnlNums.Length) { int len = CnlNums.Length; for (int i = 0; i < len; i++) { if (CnlNums[i] != srezDescr.CnlNums[i]) return false; } return true; } else { return false; } }
/// <summary> /// Проверить, идентичен ли заданный объект текущему /// </summary> public bool Equals(SrezDescr srezDescr) { if (srezDescr == this) { return(true); } else if (srezDescr != null && CS == srezDescr.CS && CnlNums.Length == srezDescr.CnlNums.Length) { int len = CnlNums.Length; for (int i = 0; i < len; i++) { if (CnlNums[i] != srezDescr.CnlNums[i]) { return(false); } } return(true); } else { return(false); } }
/// <summary> /// Check if the given object is identical to the current one. /// </summary> public bool Equals(SrezDescr srezDescr) { if (srezDescr == this) { return(true); } if (srezDescr == null || CS != srezDescr.CS || CnlNums.Length != srezDescr.CnlNums.Length) { return(false); } int len = CnlNums.Length; for (var i = 0; i < len; i++) { if (CnlNums[i] != srezDescr.CnlNums[i]) { return(false); } } return(true); }
/// <summary> /// Конструктор /// </summary> public Srez(DateTime dateTime, SrezDescr srezDescr, SrezTableLight.Srez srcSrez) : this(dateTime, srezDescr) { CopyDataFrom(srcSrez); }
/// <summary> /// Конструктор /// </summary> public Srez(DateTime dateTime, SrezDescr srezDescr) { if (srezDescr == null) throw new ArgumentNullException("srezDescr"); DateTime = dateTime; int cnlCnt = srezDescr.CnlNums.Length; CnlNums = new int[cnlCnt]; srezDescr.CnlNums.CopyTo(CnlNums, 0); CnlData = new CnlData[cnlCnt]; SrezDescr = srezDescr; State = DataRowState.Detached; Position = -1; }