/// <summary> /// Try to get the row at the given index from the buffer or cache /// </summary> /// <param name="cursor"></param> /// <returns></returns> public bool TryToGetNextRow( VoArrayListCursor cursor) { object[] vo = null; int ri = cursor.Position + 1; AssertMx.IsTrue(ri >= 0, "Invalid row index:" + ri); if (ri >= TotalRowCount) { if (DebugCaching) { DebugLog.Message(string.Format("Row {0} not in cache or buffer (cacheSize: {1}, bufferSize: {2})", ri, RowsWrittenToCache, RowBuffer.Count)); } return(false); // not in collection } vo = GetRow(ri); cursor.CurrentRow = vo; cursor.Position = ri; return(true); }
/// <summary> /// Restore the cursor state to a previous value /// </summary> /// <param name="savedState"></param> public void Restore( ref VoArrayListCursor cursorToRestore) { cursorToRestore = this; return; }
/// <summary> /// Clone the current cursor state so it can be restored later /// </summary> /// <returns></returns> public VoArrayListCursor Save() { VoArrayListCursor cs2 = (VoArrayListCursor)MemberwiseClone(); // do shallow clone return(cs2); }