Example #1
0
 private ArrayReference(ArrayReference <T> parent, int start, int length)
 {
     m_reference   = parent.m_reference;
     m_parentArray = parent;
     m_start       = start + m_parentArray.m_start;
     m_length      = length;
 }
Example #2
0
 public ArrayReference(T[] reference, int start = 0, int length = -1)
 {
     m_parentArray = null;
     m_reference   = reference;
     if (start > (reference.Length - 1) || start < 0)
     {
         throw new ArgumentOutOfRangeException("start");
     }
     m_start = start;
     if (length < 0)
     {
         m_length = m_reference.Length - start;
     }
     else
     {
         if (length > (reference.Length - start))
         {
             throw new ArgumentOutOfRangeException("length");
         }
         m_length = length;
     }
 }