示例#1
0
 /// <summary>
 /// Конструктор
 /// </summary>
 public Srez(DateTime dateTime, int cnlCnt)
     : base(dateTime, cnlCnt)
 {
     SrezDescr = new SrezDescr(cnlCnt);
     State     = DataRowState.Detached;
     Position  = -1;
 }
示例#2
0
 /// <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]);
             }
         }
     }
 }
示例#3
0
            /// <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;
            }
示例#4
0
 /// <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;
     }
 }
示例#5
0
 /// <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);
     }
 }
示例#6
0
            /// <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);
            }
示例#7
0
 /// <summary>
 /// Конструктор
 /// </summary>
 public Srez(DateTime dateTime, SrezDescr srezDescr, SrezTableLight.Srez srcSrez)
     : this(dateTime, srezDescr)
 {
     CopyDataFrom(srcSrez);
 }
示例#8
0
 /// <summary>
 /// Конструктор
 /// </summary>
 public Srez(DateTime dateTime, SrezDescr srezDescr, SrezTableLight.Srez srcSrez)
     : this(dateTime, srezDescr)
 {
     CopyDataFrom(srcSrez);
 }
示例#9
0
            /// <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;
            }
示例#10
0
 /// <summary>
 /// Конструктор
 /// </summary>
 public Srez(DateTime dateTime, int cnlCnt)
     : base(dateTime, cnlCnt)
 {
     SrezDescr = new SrezDescr(cnlCnt);
     State = DataRowState.Detached;
     Position = -1;
 }