2using System.Collections;
3using System.Threading.Tasks;
12 internal class ObjectIdCursor<T> : ICursor<T>
14 private readonly ICursor<T> cursor;
15 private readonly
string objectIdFieldName;
22 public ObjectIdCursor(ICursor<T> Cursor,
string ObjectIdFieldName)
25 this.objectIdFieldName = ObjectIdFieldName;
33 public T Current => this.cursor.Current;
44 public bool CurrentTypeCompatible => this.cursor.CurrentTypeCompatible;
51 public Guid CurrentObjectId => this.cursor.CurrentObjectId;
74 object IEnumerator.Current => this.Current;
83 public bool MoveNext() => this.MoveNextAsyncLocked().Result;
88 public void Reset() => this.cursor.Reset();
96 public Task<bool> MoveNextAsyncLocked()
98 return this.cursor.MoveNextAsyncLocked();
107 public Task<bool> MovePreviousAsyncLocked()
109 return this.cursor.MovePreviousAsyncLocked();
119 public bool SameSortOrder(
string[] ConstantFields,
string[] SortOrder)
121 return (SortOrder.Length == 1 && SortOrder[0] ==
this.objectIdFieldName);
131 public bool ReverseSortOrder(
string[] ConstantFields,
string[] SortOrder)
133 return (SortOrder.Length == 1 && SortOrder[0] ==
"-" +
this.objectIdFieldName);
140 public Task ContinueAfterLocked(T LastItem)
142 return this.cursor.ContinueAfterLocked(LastItem);
149 public Task ContinueBeforeLocked(T LastItem)
151 return this.cursor.ContinueBeforeLocked(LastItem);
Interface for asynchronous enumerators.
Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.
Interface for object serializers.