mscorlib(4.0.0.0) API with additions
BindableIterableToEnumerableAdapter.cs
1 using System.Collections;
3 using System.Security;
4 
6 {
7  internal sealed class BindableIterableToEnumerableAdapter
8  {
9  private sealed class NonGenericToGenericIterator : IIterator<object>
10  {
11  private IBindableIterator iterator;
12 
13  public object Current => iterator.Current;
14 
15  public bool HasCurrent => iterator.HasCurrent;
16 
17  public NonGenericToGenericIterator(IBindableIterator iterator)
18  {
19  this.iterator = iterator;
20  }
21 
22  public bool MoveNext()
23  {
24  return iterator.MoveNext();
25  }
26 
27  public int GetMany(object[] items)
28  {
29  throw new NotSupportedException();
30  }
31  }
32 
33  private BindableIterableToEnumerableAdapter()
34  {
35  }
36 
37  [SecurityCritical]
38  internal IEnumerator GetEnumerator_Stub()
39  {
40  IBindableIterable bindableIterable = JitHelpers.UnsafeCast<IBindableIterable>(this);
41  return new IteratorToEnumeratorAdapter<object>(new NonGenericToGenericIterator(bindableIterable.First()));
42  }
43  }
44 }
Definition: __Canon.cs:3
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Supports a simple iteration over a non-generic collection.
Definition: IEnumerator.cs:9