/// <summary> Refreshes the cursor and attempts to reposition it on the given row. </summary> /// <param name="row"> A <see cref="RemoteRow"/> structure containing the row to be positioned on after the refresh. </param> /// <returns> A <see cref="RemoteGotoData"/> structure containing the result of the refresh. </returns> public RemoteGotoData Refresh(RemoteRow row, ProcessCallInfo callInfo) { _plan.Process.ProcessCallInfo(callInfo); try { Schema.RowType type = new Schema.RowType(); for (int index = 0; index < row.Header.Columns.Length; index++) { type.Columns.Add(_serverCursor.SourceRowType.Columns[row.Header.Columns[index]].Copy()); } Row localRow = new Row(_plan.Process.ServerProcess.ValueManager, type); try { localRow.ValuesOwned = false; localRow.AsPhysical = row.Body.Data; RemoteGotoData gotoData = new RemoteGotoData(); gotoData.Success = _serverCursor.Refresh(localRow, out gotoData.Flags); return(gotoData); } finally { localRow.Dispose(); } } catch (Exception E) { throw WrapException(E); } }
protected bool SourceGotoBookmark(Guid bookmark, bool forward) { RemoteGotoData gotoData = _cursor.GotoBookmark(bookmark, forward, _plan._process.GetProcessCallInfo()); SetFlags(gotoData.Flags); _plan._programStatisticsCached = false; return(gotoData.Success); }
/// <summary> Positions the cursor on the DataBuffer denoted by the given bookmark obtained from a previous call to <c> GetBookmark </c> . </summary> /// <param name="bookmark"> A <see cref="RemoteRowBody"/> structure containing the data for the bookmark. </param> /// <returns> A <see cref="RemoteGotoData"/> structure containing the results of the goto call. </returns> public RemoteGotoData GotoBookmark(Guid bookmark, bool forward, ProcessCallInfo callInfo) { _plan.Process.ProcessCallInfo(callInfo); try { RemoteGotoData gotoData = new RemoteGotoData(); gotoData.Success = _serverCursor.GotoBookmark(bookmark, forward, out gotoData.Flags); return(gotoData); } catch (Exception E) { throw WrapException(E); } }
public bool Refresh(IRow row) { if (BufferActive()) { ClearBuffer(); } SetBufferDirection(BufferDirection.Backward); RemoteRow localRow = new RemoteRow(); _plan._process.EnsureOverflowConsistent(row); localRow.Header = new RemoteRowHeader(); localRow.Header.Columns = new string[row.DataType.Columns.Count]; for (int index = 0; index < row.DataType.Columns.Count; index++) { localRow.Header.Columns[index] = row.DataType.Columns[index].Name; } localRow.Body = new RemoteRowBody(); localRow.Body.Data = row.AsPhysical; RemoteGotoData gotoData = _cursor.Refresh(localRow, _plan._process.GetProcessCallInfo()); SetFlags(gotoData.Flags); _plan._programStatisticsCached = false; return(gotoData.Success); }
public bool FindKey(IRow key) { RemoteRow localKey = new RemoteRow(); _plan._process.EnsureOverflowConsistent(key); localKey.Header = new RemoteRowHeader(); localKey.Header.Columns = new string[key.DataType.Columns.Count]; for (int index = 0; index < key.DataType.Columns.Count; index++) { localKey.Header.Columns[index] = key.DataType.Columns[index].Name; } localKey.Body = new RemoteRowBody(); localKey.Body.Data = key.AsPhysical; RemoteGotoData gotoData = _cursor.FindKey(localKey, _plan._process.GetProcessCallInfo()); SetFlags(gotoData.Flags); _plan._programStatisticsCached = false; if (gotoData.Success && BufferActive()) { ClearBuffer(); } SetBufferDirection(BufferDirection.Backward); return(gotoData.Success); }