| 1 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. |
| 2 |
|
| 3 |
using System.Collections.Generic; |
| 4 |
|
| 5 |
namespace System.Reactive |
| 6 |
{ |
| 7 |
internal sealed class AnonymousEnumerable<T> : IEnumerable<T> |
| 8 |
{ |
| 9 |
private readonly Func<IEnumerator<T>> getEnumerator; |
| 10 |
|
| 11 |
public AnonymousEnumerable(Func<IEnumerator<T>> getEnumerator) |
| 12 |
{ |
| 13 |
this.getEnumerator = getEnumerator; |
| 14 |
} |
| 15 |
|
| 16 |
public IEnumerator<T> GetEnumerator() |
| 17 |
{ |
| 18 |
return getEnumerator(); |
| 19 |
} |
| 20 |
|
| 21 |
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
| 22 |
{ |
| 23 |
return this.GetEnumerator(); |
| 24 |
} |
| 25 |
} |
| 26 |
} |