Amnesia.Data.DisconnectedReader.SetRange C# (CSharp) Method

SetRange() public method

public SetRange ( int startIndex, int limit ) : void
startIndex int
limit int
return void
        public void SetRange(int startIndex, int limit)
        {
            if (!(rows.Count == 0 && startIndex == 0))		// with no rows in reader, do this check to make sure exception is not thrown when unnecessary
                if (startIndex < 0 || startIndex >= rows.Count)
                    throw new IndexOutOfRangeException("Start Index must be within the range of available data.");

            if (limit < 0)
                throw new ArgumentOutOfRangeException("Data limit must be greater than or equal to zero.");

            this.recordIndex = startIndex - 1;
            // do some bounds checking
            if (startIndex + limit <= rows.Count)
                this.lastIndex = startIndex + limit - 1;
            else
                this.lastIndex = rows.Count - 1;
        }