Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EmptyCursor.cs
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Threading.Tasks;
6
8{
13 internal class EmptyCursor<T> : ICursor<T>
14 {
18 internal EmptyCursor()
19 {
20 }
21
27 public T Current => throw new InvalidOperationException("Enumeration not started. Call MoveNext() first.");
28
32 public IObjectSerializer CurrentSerializer => throw new InvalidOperationException("Enumeration not started. Call MoveNext() first.");
33
38 public bool CurrentTypeCompatible => false;
39
47 Task<bool> IAsyncEnumerator.MoveNextAsync() => this.MoveNextAsyncLocked();
48
54 object IEnumerator.Current => this.Current;
55
63 public bool MoveNext() => this.MoveNextAsyncLocked().Result;
64
68 public void Reset()
69 {
70 }
71
77 public Guid CurrentObjectId => throw new InvalidOperationException("Enumeration not started. Call MoveNext() first.");
78
82 public void Dispose()
83 {
84 }
85
92 public Task<bool> MoveNextAsyncLocked()
93 {
94 return Task.FromResult(false);
95 }
96
103 public Task<bool> MovePreviousAsyncLocked()
104 {
105 return Task.FromResult(false);
106 }
107
108 public IEnumerator<T> GetEnumerator()
109 {
110 T[] A = new T[0];
111 return (IEnumerator<T>)A.GetEnumerator();
112 }
113
121 public bool SameSortOrder(string[] ConstantFields, string[] SortOrder)
122 {
123 return false;
124 }
125
133 public bool ReverseSortOrder(string[] ConstantFields, string[] SortOrder)
134 {
135 return false;
136 }
137
142 public Task ContinueAfterLocked(T LastItem)
143 {
144 return Task.CompletedTask;
145 }
146
151 public Task ContinueBeforeLocked(T LastItem)
152 {
153 return Task.CompletedTask;
154 }
155 }
156}
Interface for asynchronous enumerators.
Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.