Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReversedCursor.cs
1using System;
2using System.Collections;
3using System.Threading.Tasks;
5
7{
12 internal class ReversedCursor<T> : ICursor<T>
13 {
14 private readonly ICursor<T> cursor;
15
20 internal ReversedCursor(ICursor<T> Cursor)
21 {
22 this.cursor = Cursor;
23 }
24
30 public T Current
31 {
32 get
33 {
34 return this.cursor.Current;
35 }
36 }
37
41 public IObjectSerializer CurrentSerializer
42 {
43 get
44 {
45 return this.cursor.CurrentSerializer;
46 }
47 }
48
53 public bool CurrentTypeCompatible
54 {
55 get
56 {
57 return this.cursor.CurrentTypeCompatible;
58 }
59 }
60
66 public Guid CurrentObjectId
67 {
68 get
69 {
70 return this.cursor.CurrentObjectId;
71 }
72 }
73
77 public void Dispose()
78 {
79 }
80
88 Task<bool> IAsyncEnumerator.MoveNextAsync() => this.MoveNextAsyncLocked();
89
95 object IEnumerator.Current => this.Current;
96
104 public bool MoveNext() => this.MoveNextAsyncLocked().Result;
105
109 public void Reset() => this.cursor.Reset();
110
117 public Task<bool> MoveNextAsyncLocked()
118 {
119 return this.cursor.MovePreviousAsyncLocked();
120 }
121
128 public Task<bool> MovePreviousAsyncLocked()
129 {
130 return this.cursor.MoveNextAsyncLocked();
131 }
132
140 public bool SameSortOrder(string[] ConstantFields, string[] SortOrder)
141 {
142 return this.cursor.ReverseSortOrder(ConstantFields, SortOrder);
143 }
144
152 public bool ReverseSortOrder(string[] ConstantFields, string[] SortOrder)
153 {
154 return this.cursor.SameSortOrder(ConstantFields, SortOrder);
155 }
156
161 public Task ContinueAfterLocked(T LastItem)
162 {
163 return this.cursor.ContinueBeforeLocked(LastItem);
164 }
165
170 public Task ContinueBeforeLocked(T LastItem)
171 {
172 return this.cursor.ContinueAfterLocked(LastItem);
173 }
174 }
175}
Interface for asynchronous enumerators.
Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.