Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/rx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Rx.NET/System.Reactive.Linq/Reactive/Internal/AnonymousEnumerable.cs')
-rw-r--r--Rx.NET/System.Reactive.Linq/Reactive/Internal/AnonymousEnumerable.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/Rx.NET/System.Reactive.Linq/Reactive/Internal/AnonymousEnumerable.cs b/Rx.NET/System.Reactive.Linq/Reactive/Internal/AnonymousEnumerable.cs
new file mode 100644
index 0000000..b14b89b
--- /dev/null
+++ b/Rx.NET/System.Reactive.Linq/Reactive/Internal/AnonymousEnumerable.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+
+namespace System.Reactive
+{
+ internal sealed class AnonymousEnumerable<T> : IEnumerable<T>
+ {
+ private readonly Func<IEnumerator<T>> getEnumerator;
+
+ public AnonymousEnumerable(Func<IEnumerator<T>> getEnumerator)
+ {
+ this.getEnumerator = getEnumerator;
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ return getEnumerator();
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return this.GetEnumerator();
+ }
+ }
+}