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 'Ix/NET/System.Interactive/EnumerableEx.Creation.cs')
-rw-r--r--Ix/NET/System.Interactive/EnumerableEx.Creation.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ix/NET/System.Interactive/EnumerableEx.Creation.cs b/Ix/NET/System.Interactive/EnumerableEx.Creation.cs
index 2ba4f16..3bfa3a3 100644
--- a/Ix/NET/System.Interactive/EnumerableEx.Creation.cs
+++ b/Ix/NET/System.Interactive/EnumerableEx.Creation.cs
@@ -20,6 +20,17 @@ namespace System.Linq
return new AnonymousEnumerable<TResult>(getEnumerator);
}
+#if HAS_AWAIT
+ public static IEnumerable<T> Create<T>(Action<IYielder<T>> create)
+ {
+ if (create == null)
+ throw new ArgumentNullException("create");
+
+ foreach (var x in new Yielder<T>(create))
+ yield return x;
+ }
+#endif
+
class AnonymousEnumerable<TResult> : IEnumerable<TResult>
{
private readonly Func<IEnumerator<TResult>> _getEnumerator;