浏览代码

Cherry pick commit e580d7e from branch 'develop': SelectMany overloads with index parameter in selector functions.

davedev 12 年之前
父节点
当前提交
1945e8b31a

+ 10 - 16
Rx.NET/Source/Microsoft.Reactive.Testing/ReactiveTest.cs

@@ -65,15 +65,13 @@ namespace Microsoft.Reactive.Testing
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Factory method for an OnCompleted notification record at a given time.
+        /// Factory method for an OnCompleted notification record at a given time, using inference to determine the type of <typeparamref name="T"/>.
         /// </summary>
         /// </summary>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
-        /// <param name="dummy">An unused instance of type T, to force the compiler to infer that T as part of the method's return value.</param>
         /// <param name="ticks">Recorded virtual time the OnCompleted notification occurs.</param>
         /// <param name="ticks">Recorded virtual time the OnCompleted notification occurs.</param>
+        /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnCompleted notification.</returns>
         /// <returns>Recorded OnCompleted notification.</returns>
-        /// <remarks>This overload is used for anonymous types - by passing in an instance of the type, the compiler can infer the 
-        /// anonymous type without you having to try naming the type.</remarks>
-        public static Recorded<Notification<T>> OnCompleted<T>(T dummy, long ticks)
+        public static Recorded<Notification<T>> OnCompleted<T>(long ticks, T witness)
         {
         {
             return new Recorded<Notification<T>>(ticks, Notification.CreateOnCompleted<T>());
             return new Recorded<Notification<T>>(ticks, Notification.CreateOnCompleted<T>());
         }
         }
@@ -109,19 +107,17 @@ namespace Microsoft.Reactive.Testing
 
 
             return new Recorded<Notification<T>>(ticks, new OnErrorPredicate<T>(predicate));
             return new Recorded<Notification<T>>(ticks, new OnErrorPredicate<T>(predicate));
         }
         }
-
+        
         /// <summary>
         /// <summary>
-        /// Factory method for an OnError notification record at a given time with a given error.
+        /// Factory method for an OnError notification record at a given time with a given error, using inference to determine the type of <typeparamref name="T"/>.
         /// </summary>
         /// </summary>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
-        /// <param name="dummy">An unused instance of type T, to force the compiler to infer that T as part of the method's return value.</param>
         /// <param name="ticks">Recorded virtual time the OnError notification occurs.</param>
         /// <param name="ticks">Recorded virtual time the OnError notification occurs.</param>
         /// <param name="exception">Recorded exception stored in the OnError notification.</param>
         /// <param name="exception">Recorded exception stored in the OnError notification.</param>
+        /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnError notification.</returns>
         /// <returns>Recorded OnError notification.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="exception"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="exception"/> is null.</exception>
-        /// <remarks>This overload is used for anonymous types - by passing in an instance of the type, the compiler can infer the 
-        /// anonymous type without you having to try naming the type.</remarks>
-        public static Recorded<Notification<T>> OnError<T>(T dummy, long ticks, Exception exception)
+        public static Recorded<Notification<T>> OnError<T>(long ticks, Exception exception, T witness)
         {
         {
             if (exception == null)
             if (exception == null)
                 throw new ArgumentNullException("exception");
                 throw new ArgumentNullException("exception");
@@ -130,17 +126,15 @@ namespace Microsoft.Reactive.Testing
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Factory method for writing an assert that checks for an OnError notification record at a given time, using the specified predicate to check the exception.
+        /// Factory method for writing an assert that checks for an OnError notification record at a given time, using the specified predicate to check the exception and inference to determine the type of <typeparamref name="T"/>.
         /// </summary>
         /// </summary>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
         /// <typeparam name="T">The element type for the resulting notification object.</typeparam>
-        /// <param name="dummy">An unused instance of type T, to force the compiler to infer that T as part of the method's return value.</param>
         /// <param name="ticks">Recorded virtual time the OnError notification occurs.</param>
         /// <param name="ticks">Recorded virtual time the OnError notification occurs.</param>
         /// <param name="predicate">Predicate function to check the OnError notification value against an expected exception.</param>
         /// <param name="predicate">Predicate function to check the OnError notification value against an expected exception.</param>
+        /// <param name="witness">Object solely used to infer the type of the <typeparamref name="T"/> type parameter. This parameter is typically used when creating a sequence of anonymously typed elements.</param>
         /// <returns>Recorded OnError notification with a predicate to assert a given exception.</returns>
         /// <returns>Recorded OnError notification with a predicate to assert a given exception.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="predicate"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="predicate"/> is null.</exception>
-        /// <remarks>This overload is used for anonymous types - by passing in an instance of the type, the compiler can infer the 
-        /// anonymous type without you having to try naming the type.</remarks>
-        public static Recorded<Notification<T>> OnError<T>(T dummy, long ticks, Func<Exception, bool> predicate)
+        public static Recorded<Notification<T>> OnError<T>(long ticks, Func<Exception, bool> predicate, T witness)
         {
         {
             if (predicate == null)
             if (predicate == null)
                 throw new ArgumentNullException("predicate");
                 throw new ArgumentNullException("predicate");

+ 2 - 1
Rx.NET/Source/System.Reactive.Experimental/Reactive/Linq/QbservableEx.Generated.cs

@@ -1,5 +1,6 @@
 /*
 /*
- * WARNING: Auto-generated file (8/5/2012 1:55:31 PM)
+ * WARNING: Auto-generated file (11/1/2013 5:54:10 PM)
+ * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
  */
  */
 
 
 #pragma warning disable 1591
 #pragma warning disable 1591

+ 6 - 3
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/IQueryLanguage.cs

@@ -1,6 +1,5 @@
 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Concurrency;
@@ -9,7 +8,7 @@ using System.Reactive.Subjects;
 using System.Threading;
 using System.Threading;
 
 
 #if !NO_REMOTING
 #if !NO_REMOTING
-using System.Runtime.Remoting.Lifetime;
+
 #endif
 #endif
 
 
 #if !NO_TPL
 #if !NO_TPL
@@ -698,7 +697,7 @@ namespace System.Reactive.Linq
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted);
-        IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, int, IObservable<TResult>> onError, Func<int, IObservable<TResult>> onCompleted);
+        IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector);
@@ -715,9 +714,13 @@ namespace System.Reactive.Linq
 
 
 #if !NO_TPL
 #if !NO_TPL
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector);
+        IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector);
+        IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
+        IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
+        IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
 #endif
 #endif
 
 
         #endregion
         #endregion

+ 102 - 15
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable.StandardSequenceOperators.cs

@@ -545,12 +545,12 @@ namespace System.Reactive.Linq
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+        /// Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> selector)
         public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> selector)
@@ -584,6 +584,26 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TResult>(source, selector);
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
         }
 
 
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
+        /// <remarks>This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="TaskObservableExtensions.ToObservable&lt;TResult&gt;"/>.</remarks>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
+        public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (selector == null)
+                throw new ArgumentNullException("selector");
+
+            return s_impl.SelectMany<TSource, TResult>(source, selector);
+        }
+
         /// <summary>
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// </summary>
         /// </summary>
@@ -603,6 +623,26 @@ namespace System.Reactive.Linq
 
 
             return s_impl.SelectMany<TSource, TResult>(source, selector);
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
         }
+
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
+        /// <remarks>This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="TaskObservableExtensions.ToObservable&lt;TResult&gt;"/>.</remarks>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
+        public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (selector == null)
+                throw new ArgumentNullException("selector");
+
+            return s_impl.SelectMany<TSource, TResult>(source, selector);
+        }
 #endif
 #endif
 
 
         /// <summary>
         /// <summary>
@@ -629,14 +669,14 @@ namespace System.Reactive.Linq
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+        /// Projects each element of an observable sequence to an observable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="collectionSelector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
+        /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="collectionSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="collectionSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
         public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
@@ -676,6 +716,30 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
         }
 
 
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
+        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="taskSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="taskSelector"/> or <paramref name="resultSelector"/> is null.</exception>
+        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="TaskObservableExtensions.ToObservable&lt;TResult&gt;"/>.</remarks>
+        public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (taskSelector == null)
+                throw new ArgumentNullException("taskSelector");
+            if (resultSelector == null)
+                throw new ArgumentNullException("resultSelector");
+
+            return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
+        }
+
         /// <summary>
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
         /// </summary>
@@ -699,6 +763,30 @@ namespace System.Reactive.Linq
 
 
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
         }
+
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
+        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="taskSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="taskSelector"/> or <paramref name="resultSelector"/> is null.</exception>
+        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="TaskObservableExtensions.ToObservable&lt;TResult&gt;"/>.</remarks>
+        public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (taskSelector == null)
+                throw new ArgumentNullException("taskSelector");
+            if (resultSelector == null)
+                throw new ArgumentNullException("resultSelector");
+
+            return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
+        }
 #endif
 #endif
 
 
         /// <summary>
         /// <summary>
@@ -727,17 +815,17 @@ namespace System.Reactive.Linq
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+        /// Projects each notification of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of notifications to project.</param>
         /// <param name="source">An observable sequence of notifications to project.</param>
-        /// <param name="onNext">A transform function to apply to each element; the second parameter represents the index of the source element.</param>
-        /// <param name="onError">A transform function to apply when an error occurs in the source sequence; the second parameter represents the index of the source element.</param>
-        /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached; the second parameter represents the number of elements observed.</param>
+        /// <param name="onNext">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="onError">A transform function to apply when an error occurs in the source sequence.</param>
+        /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is null.</exception>
-        public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, int, IObservable<TResult>> onError, Func<int, IObservable<TResult>> onCompleted)
+        public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
@@ -772,13 +860,12 @@ namespace System.Reactive.Linq
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
-        /// The index of each source element is used in the projected form of that element. 
+        /// Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index and concatenates the resulting enumerable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <remarks>The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the <see cref="Observable.ToObservable&lt;TSource&gt;(IEnumerable&lt;TSource&gt;)"/> conversion.</remarks>
         /// <remarks>The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the <see cref="Observable.ToObservable&lt;TSource&gt;(IEnumerable&lt;TSource&gt;)"/> conversion.</remarks>
@@ -817,14 +904,14 @@ namespace System.Reactive.Linq
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an enumerable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+        /// Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="collectionSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="collectionSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         /// <remarks>The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the <see cref="Observable.ToObservable&lt;TSource&gt;(IEnumerable&lt;TSource&gt;)"/> conversion.</remarks>
         /// <remarks>The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the <see cref="Observable.ToObservable&lt;TSource&gt;(IEnumerable&lt;TSource&gt;)"/> conversion.</remarks>

文件差异内容过多而无法显示
+ 670 - 106
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable/SelectMany.cs


+ 116 - 16
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs

@@ -1,13 +1,10 @@
 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
 
 
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Concurrency;
-using System.Reactive.Disposables;
-using System.Reactive.Subjects;
+
 
 
 #if !NO_TPL
 #if !NO_TPL
-using System.Reactive.Threading.Tasks;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 #endif
 #endif
@@ -853,12 +850,30 @@ namespace System.Reactive.Linq
 #endif
 #endif
         }
         }
 
 
+        public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector)
+        {
+#if !NO_PERF
+            return new SelectMany<TSource, TResult>(source, (x, i, token) => selector(x, i));
+#else
+            return SelectMany_<TSource, TResult>(source, (x, i) => selector(x, i).ToObservable());
+#endif
+        }
+
         public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector)
         public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector)
         {
         {
 #if !NO_PERF
 #if !NO_PERF
             return new SelectMany<TSource, TResult>(source, selector);
             return new SelectMany<TSource, TResult>(source, selector);
 #else
 #else
             return SelectMany_<TSource, TResult>(source, x => FromAsync(ct => selector(x, ct)));
             return SelectMany_<TSource, TResult>(source, x => FromAsync(ct => selector(x, ct)));
+#endif
+        }
+
+        public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector)
+        {
+#if !NO_PERF
+            return new SelectMany<TSource, TResult>(source, selector);
+#else
+            return SelectMany_<TSource, TResult>(source, (x, i) => FromAsync(ct => selector(x, i, ct)));
 #endif
 #endif
         }
         }
 #endif
 #endif
@@ -883,12 +898,30 @@ namespace System.Reactive.Linq
 #endif
 #endif
         }
         }
 
 
+        public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
+        {
+#if !NO_PERF
+            return new SelectMany<TSource, TTaskResult, TResult>(source, (x, i, token) => taskSelector(x, i), resultSelector);
+#else
+            return SelectMany_<TSource, TTaskResult, TResult>(source, (x, i) => taskSelector(x, i).ToObservable(), (x, i, t, _) => resultSelector(x, i, t));
+#endif
+        }
+
         public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
         public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
         {
         {
 #if !NO_PERF
 #if !NO_PERF
             return new SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
             return new SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
 #else
 #else
             return SelectMany_<TSource, TTaskResult, TResult>(source, x => FromAsync(ct => taskSelector(x, ct)), resultSelector);
             return SelectMany_<TSource, TTaskResult, TResult>(source, x => FromAsync(ct => taskSelector(x, ct)), resultSelector);
+#endif
+        }
+
+        public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
+        {
+#if !NO_PERF
+            return new SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
+#else
+            return SelectMany_<TSource, TTaskResult, TResult>(source, (x, i) => FromAsync(ct => taskSelector(x, i, ct)), (x, i, t, _) => resultSelector(x, i, t));
 #endif
 #endif
         }
         }
 #endif
 #endif
@@ -901,7 +934,7 @@ namespace System.Reactive.Linq
             return source.Select(selector).Merge();
             return source.Select(selector).Merge();
 #endif
 #endif
         }
         }
-
+        
         private static IObservable<TResult> SelectMany_<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> selector)
         private static IObservable<TResult> SelectMany_<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> selector)
         {
         {
 #if !NO_PERF
 #if !NO_PERF
@@ -925,7 +958,7 @@ namespace System.Reactive.Linq
 #if !NO_PERF
 #if !NO_PERF
             return new SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
             return new SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
 #else
 #else
-            return SelectMany_<TSource, TResult>(source, x => collectionSelector(x).Select(y => resultSelector(x, y)));
+            return SelectMany_<TSource, TResult>(source, (x, i) => collectionSelector(x, i).Select((y, i2) => resultSelector(x, i, y, i2)));
 #endif
 #endif
         }
         }
 
 
@@ -946,19 +979,23 @@ namespace System.Reactive.Linq
 #endif
 #endif
         }
         }
 
 
-        public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, int, IObservable<TResult>> onError, Func<int, IObservable<TResult>> onCompleted)
+        public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted)
         {
         {
 #if !NO_PERF
 #if !NO_PERF
             return new SelectMany<TSource, TResult>(source, onNext, onError, onCompleted);
             return new SelectMany<TSource, TResult>(source, onNext, onError, onCompleted);
 #else
 #else
-            return source.Materialize().SelectMany(notification =>
+            return Defer(() =>
             {
             {
-                if (notification.Kind == NotificationKind.OnNext)
-                    return onNext(notification.Value);
-                else if (notification.Kind == NotificationKind.OnError)
-                    return onError(notification.Exception);
-                else
-                    return onCompleted();
+                var index = 0;
+                return source.Materialize().SelectMany(notification =>
+                {
+                    if (notification.Kind == NotificationKind.OnNext)
+                        return onNext(notification.Value, checked(index++));
+                    else if (notification.Kind == NotificationKind.OnError)
+                        return onError(notification.Exception);
+                    else
+                        return onCompleted();
+                });
             });
             });
 #endif
 #endif
         }
         }
@@ -977,7 +1014,7 @@ namespace System.Reactive.Linq
 #if !NO_PERF
 #if !NO_PERF
             return new SelectMany<TSource, TResult>(source, selector);
             return new SelectMany<TSource, TResult>(source, selector);
 #else
 #else
-            return SelectMany_<TSource, TResult, TResult>(source, selector, (_, x) => x);
+            return SelectMany_<TSource, TResult, TResult>(source, selector, (_, __, x, ___) => x);
 #endif
 #endif
         }
         }
 
 
@@ -986,6 +1023,11 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
             return SelectMany_<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
         }
         }
 
 
+        public virtual IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
+        {
+            return SelectMany_<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
+        }
+
         private static IObservable<TResult> SelectMany_<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         private static IObservable<TResult> SelectMany_<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
         {
 #if !NO_PERF
 #if !NO_PERF
@@ -1045,9 +1087,67 @@ namespace System.Reactive.Linq
 #endif
 #endif
         }
         }
 
 
-        public virtual IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
+        private static IObservable<TResult> SelectMany_<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
         {
         {
+#if !NO_PERF
             return new SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
             return new SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
+#else
+            return new AnonymousObservable<TResult>(observer => 
+            {
+                var index = 0;
+
+                return source.Subscribe(
+                    x =>
+                    {
+                        var xs = default(IEnumerable<TCollection>);
+                        try
+                        {
+                            xs = collectionSelector(x, checked(index++));
+                        }
+                        catch (Exception exception)
+                        {
+                            observer.OnError(exception);
+                            return;
+                        }
+
+                        var e = xs.GetEnumerator();
+
+                        try
+                        {
+                            var eIndex = 0;
+                            var hasNext = true;
+                            while (hasNext)
+                            {
+                                hasNext = false;
+                                var current = default(TResult);
+
+                                try
+                                {
+                                    hasNext = e.MoveNext();
+                                    if (hasNext)
+                                        current = resultSelector(x, index, e.Current, checked(eIndex++));
+                                }
+                                catch (Exception exception)
+                                {
+                                    observer.OnError(exception);
+                                    return;
+                                }
+
+                                if (hasNext)
+                                    observer.OnNext(current);
+                            }
+                        }
+                        finally
+                        {
+                            if (e != null)
+                                e.Dispose();
+                        }
+                    },
+                    observer.OnError,
+                    observer.OnCompleted
+                )
+            });
+#endif
         }
         }
 
 
         #endregion
         #endregion

+ 270 - 125
Rx.NET/Source/System.Reactive.Providers/Reactive/Linq/Qbservable.Generated.cs

@@ -1,5 +1,5 @@
 /*
 /*
- * WARNING: Auto-generated file (1/10/2013 8:30:32 PM)
+ * WARNING: Auto-generated file (11/1/2013 5:54:10 PM)
  * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
  * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
  */
  */
 
 
@@ -8508,27 +8508,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Double" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Int32&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Double" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<int?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)
+        public static IQbservable<double> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<int?>(
+            return source.Provider.CreateQuery<double>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int?>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8539,27 +8539,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Single" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Int64&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Single" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<long?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)
+        public static IQbservable<float> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<long?>(
+            return source.Provider.CreateQuery<float>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long?>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8570,27 +8570,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Decimal" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Double" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Decimal" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<double> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)
+        public static IQbservable<decimal> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<double>(
+            return source.Provider.CreateQuery<decimal>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8601,27 +8601,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Int32" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Single" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Int32" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<float> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)
+        public static IQbservable<int> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<float>(
+            return source.Provider.CreateQuery<int>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8632,27 +8632,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Int64" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Decimal" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Int64" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<decimal> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)
+        public static IQbservable<long> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<decimal>(
+            return source.Provider.CreateQuery<long>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8663,27 +8663,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Double" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Int32" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Double&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<int> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)
+        public static IQbservable<double?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<int>(
+            return source.Provider.CreateQuery<double?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8694,27 +8694,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="T:System.Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Single" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Int64" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Single&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<long> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)
+        public static IQbservable<float?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<long>(
+            return source.Provider.CreateQuery<float?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8725,27 +8725,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Decimal" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Double&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Decimal&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<double?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)
+        public static IQbservable<decimal?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<double?>(
+            return source.Provider.CreateQuery<decimal?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double?>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8756,27 +8756,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Int32" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Single&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Int32&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<float?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)
+        public static IQbservable<int?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<float?>(
+            return source.Provider.CreateQuery<int?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float?>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -8787,27 +8787,27 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="T:System.Int64" /> value.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Decimal&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="T:System.Nullable&lt;System.Int64&gt;" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<decimal?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+        public static IQbservable<long?> Max<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<decimal?>(
+            return source.Provider.CreateQuery<long?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal?>>))),
+                    InfoOf(() => Qbservable.Max<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -11467,14 +11467,14 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+        /// Projects each element of an observable sequence to an observable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="collectionSelector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
+        /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
@@ -11540,14 +11540,14 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an enumerable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+        /// Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
         /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <param name="collectionSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
@@ -11647,18 +11647,18 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+        /// Projects each notification of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of notifications to project.</param>
         /// <param name="source">An observable sequence of notifications to project.</param>
-        /// <param name="onNext">A transform function to apply to each element; the second parameter represents the index of the source element.</param>
-        /// <param name="onError">A transform function to apply when an error occurs in the source sequence; the second parameter represents the index of the source element.</param>
-        /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached; the second parameter represents the number of elements observed.</param>
+        /// <param name="onNext">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="onError">A transform function to apply when an error occurs in the source sequence.</param>
+        /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="onNext" /> or <paramref name="onError" /> or <paramref name="onCompleted" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="onNext" /> or <paramref name="onError" /> or <paramref name="onCompleted" /> is null.</exception>
-        public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> onNext, Expression<Func<Exception, int, IObservable<TResult>>> onError, Expression<Func<int, IObservable<TResult>>> onCompleted)
+        public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
@@ -11673,7 +11673,7 @@ namespace System.Reactive.Linq
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.SelectMany<TSource, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, IObservable<TResult>>>), default(Expression<Func<Exception, int, IObservable<TResult>>>), default(Expression<Func<int, IObservable<TResult>>>))),
+                    InfoOf(() => Qbservable.SelectMany<TSource, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, IObservable<TResult>>>), default(Expression<Func<Exception, IObservable<TResult>>>), default(Expression<Func<IObservable<TResult>>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
 #endif
 #endif
@@ -11717,12 +11717,12 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+        /// Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
@@ -11781,6 +11781,40 @@ namespace System.Reactive.Linq
         }
         }
 #endif
 #endif
         
         
+#if !NO_TPL
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
+        /// <remarks>This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="M:System.Reactive.Threading.Tasks.TaskObservableExtensions.ToObservable``1(System.Threading.Tasks.Task{``0})" />.</remarks>
+        /// <exception cref="T:System.ArgumentNullException">
+        /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TResult>>> selector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (selector == null)
+                throw new ArgumentNullException("selector");
+            
+            return source.Provider.CreateQuery<TResult>(
+                Expression.Call(
+                    null,
+#if CRIPPLED_REFLECTION
+                    InfoOf(() => Qbservable.SelectMany<TSource, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, Task<TResult>>>))),
+#else
+                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
+#endif
+                    source.Expression,
+                    selector
+                )
+            );
+        }
+#endif
+        
 #if !NO_TPL
 #if !NO_TPL
         /// <summary>
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
@@ -11815,6 +11849,40 @@ namespace System.Reactive.Linq
         }
         }
 #endif
 #endif
         
         
+#if !NO_TPL
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
+        /// <remarks>This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="M:System.Reactive.Threading.Tasks.TaskObservableExtensions.ToObservable``1(System.Threading.Tasks.Task{``0})" />.</remarks>
+        /// <exception cref="T:System.ArgumentNullException">
+        /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TResult>>> selector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (selector == null)
+                throw new ArgumentNullException("selector");
+            
+            return source.Provider.CreateQuery<TResult>(
+                Expression.Call(
+                    null,
+#if CRIPPLED_REFLECTION
+                    InfoOf(() => Qbservable.SelectMany<TSource, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, CancellationToken, Task<TResult>>>))),
+#else
+                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
+#endif
+                    source.Expression,
+                    selector
+                )
+            );
+        }
+#endif
+        
         /// <summary>
         /// <summary>
         /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
         /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
         /// </summary>
         /// </summary>
@@ -11848,13 +11916,12 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
-        /// The index of each source element is used in the projected form of that element. 
+        /// Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index and concatenates the resulting enumerable sequences into one observable sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
         /// <param name="source">An observable sequence of elements to project.</param>
         /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="selector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <returns>An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
@@ -11919,6 +11986,45 @@ namespace System.Reactive.Linq
         }
         }
 #endif
 #endif
         
         
+#if !NO_TPL
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
+        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="taskSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element.</returns>
+        /// <exception cref="T:System.ArgumentNullException">
+        /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
+        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="M:System.Reactive.Threading.Tasks.TaskObservableExtensions.ToObservable``1(System.Threading.Tasks.Task{``0})" />.</remarks>
+        public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (taskSelector == null)
+                throw new ArgumentNullException("taskSelector");
+            if (resultSelector == null)
+                throw new ArgumentNullException("resultSelector");
+            
+            return source.Provider.CreateQuery<TResult>(
+                Expression.Call(
+                    null,
+#if CRIPPLED_REFLECTION
+                    InfoOf(() => Qbservable.SelectMany<TSource, TTaskResult, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, Task<TTaskResult>>>), default(Expression<Func<TSource, int, TTaskResult, TResult>>))),
+#else
+                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTaskResult), typeof(TResult)),
+#endif
+                    source.Expression,
+                    taskSelector,
+                    resultSelector
+                )
+            );
+        }
+#endif
+        
 #if !NO_TPL
 #if !NO_TPL
         /// <summary>
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
@@ -11958,6 +12064,45 @@ namespace System.Reactive.Linq
         }
         }
 #endif
 #endif
         
         
+#if !NO_TPL
+        /// <summary>
+        /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
+        /// </summary>
+        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
+        /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
+        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results.</typeparam>
+        /// <param name="source">An observable sequence of elements to project.</param>
+        /// <param name="taskSelector">A transform function to apply to each element; the second parameter of the function represents the index of the source element.</param>
+        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element.</param>
+        /// <returns>An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element.</returns>
+        /// <exception cref="T:System.ArgumentNullException">
+        /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
+        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using <see cref="M:System.Reactive.Threading.Tasks.TaskObservableExtensions.ToObservable``1(System.Threading.Tasks.Task{``0})" />.</remarks>
+        public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+            if (taskSelector == null)
+                throw new ArgumentNullException("taskSelector");
+            if (resultSelector == null)
+                throw new ArgumentNullException("resultSelector");
+            
+            return source.Provider.CreateQuery<TResult>(
+                Expression.Call(
+                    null,
+#if CRIPPLED_REFLECTION
+                    InfoOf(() => Qbservable.SelectMany<TSource, TTaskResult, TResult>(default(IQbservable<TSource>), default(Expression<Func<TSource, int, CancellationToken, Task<TTaskResult>>>), default(Expression<Func<TSource, int, TTaskResult, TResult>>))),
+#else
+                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTaskResult), typeof(TResult)),
+#endif
+                    source.Expression,
+                    taskSelector,
+                    resultSelector
+                )
+            );
+        }
+#endif
+        
         /// <summary>
         /// <summary>
         /// Determines whether two sequences are equal by comparing the elements pairwise.
         /// Determines whether two sequences are equal by comparing the elements pairwise.
         /// </summary>
         /// </summary>
@@ -13403,7 +13548,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="T:System.Double" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="T:System.Int32" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13411,19 +13556,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int32.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<double> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)
+        public static IQbservable<int?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<double>(
+            return source.Provider.CreateQuery<int?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13434,7 +13580,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="T:System.Int64" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13442,19 +13588,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int64.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<float> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)
+        public static IQbservable<long?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<float>(
+            return source.Provider.CreateQuery<long?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13465,7 +13612,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="T:System.Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="T:System.Double" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13473,20 +13620,19 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Decimal.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<decimal> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)
+        public static IQbservable<double> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<decimal>(
+            return source.Provider.CreateQuery<double>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13497,7 +13643,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="T:System.Int32" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13505,20 +13651,19 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int32.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<int> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)
+        public static IQbservable<float> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<int>(
+            return source.Provider.CreateQuery<float>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13529,7 +13674,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="T:System.Int64" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="T:System.Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13537,20 +13682,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int64.MaxValue" />.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Decimal.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<long> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)
+        public static IQbservable<decimal> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<long>(
+            return source.Provider.CreateQuery<decimal>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13561,7 +13706,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="T:System.Double" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="T:System.Int32" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13569,19 +13714,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int32.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<double?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)
+        public static IQbservable<int> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<double?>(
+            return source.Provider.CreateQuery<int>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double?>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13592,7 +13738,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="T:System.Int64" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13600,19 +13746,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int64.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<float?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)
+        public static IQbservable<long> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<float?>(
+            return source.Provider.CreateQuery<long>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float?>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13623,7 +13770,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="T:System.Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="T:System.Double" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13631,20 +13778,19 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Decimal.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<decimal?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+        public static IQbservable<double?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<decimal?>(
+            return source.Provider.CreateQuery<double?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal?>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, double?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13655,7 +13801,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="T:System.Int32" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13663,20 +13809,19 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int32.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<int?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)
+        public static IQbservable<float?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<int?>(
+            return source.Provider.CreateQuery<float?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, int?>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, float?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -13687,7 +13832,7 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="T:System.Int64" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="T:System.Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
@@ -13695,20 +13840,20 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
         /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
-        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Int64.MaxValue" />.</exception>
+        /// <exception cref="T:System.OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="M:System.Decimal.MaxValue" />.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        public static IQbservable<long?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)
+        public static IQbservable<decimal?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)
         {
         {
             if (source == null)
             if (source == null)
                 throw new ArgumentNullException("source");
                 throw new ArgumentNullException("source");
             if (selector == null)
             if (selector == null)
                 throw new ArgumentNullException("selector");
                 throw new ArgumentNullException("selector");
             
             
-            return source.Provider.CreateQuery<long?>(
+            return source.Provider.CreateQuery<decimal?>(
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, long?>>))),
+                    InfoOf(() => Qbservable.Sum<TSource>(default(IQbservable<TSource>), default(Expression<Func<TSource, decimal?>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
 #endif
@@ -16640,18 +16785,18 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Merges two observable sequences into one observable sequence by combining their elements in a pairwise fashion.
+        /// Merges an observable sequence and an enumerable sequence into one observable sequence by using the selector function.
         /// </summary>
         /// </summary>
-        /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
-        /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
+        /// <typeparam name="TSource1">The type of the elements in the first observable source sequence.</typeparam>
+        /// <typeparam name="TSource2">The type of the elements in the second enumerable source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
         /// <param name="first">First observable source.</param>
         /// <param name="first">First observable source.</param>
-        /// <param name="second">Second observable source.</param>
+        /// <param name="second">Second enumerable source.</param>
         /// <param name="resultSelector">Function to invoke for each consecutive pair of elements from the first and second source.</param>
         /// <param name="resultSelector">Function to invoke for each consecutive pair of elements from the first and second source.</param>
         /// <returns>An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function.</returns>
         /// <returns>An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="first" /> or <paramref name="second" /> or <paramref name="resultSelector" /> is null.</exception>
         /// <paramref name="first" /> or <paramref name="second" /> or <paramref name="resultSelector" /> is null.</exception>
-        public static IQbservable<TResult> Zip<TSource1, TSource2, TResult>(this IQbservable<TSource1> first, IObservable<TSource2> second, Expression<Func<TSource1, TSource2, TResult>> resultSelector)
+        public static IQbservable<TResult> Zip<TSource1, TSource2, TResult>(this IQbservable<TSource1> first, IEnumerable<TSource2> second, Expression<Func<TSource1, TSource2, TResult>> resultSelector)
         {
         {
             if (first == null)
             if (first == null)
                 throw new ArgumentNullException("first");
                 throw new ArgumentNullException("first");
@@ -16664,7 +16809,7 @@ namespace System.Reactive.Linq
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Zip<TSource1, TSource2, TResult>(default(IQbservable<TSource1>), default(IObservable<TSource2>), default(Expression<Func<TSource1, TSource2, TResult>>))),
+                    InfoOf(() => Qbservable.Zip<TSource1, TSource2, TResult>(default(IQbservable<TSource1>), default(IEnumerable<TSource2>), default(Expression<Func<TSource1, TSource2, TResult>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
 #endif
 #endif
@@ -16676,18 +16821,18 @@ namespace System.Reactive.Linq
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Merges an observable sequence and an enumerable sequence into one observable sequence by using the selector function.
+        /// Merges two observable sequences into one observable sequence by combining their elements in a pairwise fashion.
         /// </summary>
         /// </summary>
-        /// <typeparam name="TSource1">The type of the elements in the first observable source sequence.</typeparam>
-        /// <typeparam name="TSource2">The type of the elements in the second enumerable source sequence.</typeparam>
+        /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
+        /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
         /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
         /// <param name="first">First observable source.</param>
         /// <param name="first">First observable source.</param>
-        /// <param name="second">Second enumerable source.</param>
+        /// <param name="second">Second observable source.</param>
         /// <param name="resultSelector">Function to invoke for each consecutive pair of elements from the first and second source.</param>
         /// <param name="resultSelector">Function to invoke for each consecutive pair of elements from the first and second source.</param>
         /// <returns>An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function.</returns>
         /// <returns>An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function.</returns>
         /// <exception cref="T:System.ArgumentNullException">
         /// <exception cref="T:System.ArgumentNullException">
         /// <paramref name="first" /> or <paramref name="second" /> or <paramref name="resultSelector" /> is null.</exception>
         /// <paramref name="first" /> or <paramref name="second" /> or <paramref name="resultSelector" /> is null.</exception>
-        public static IQbservable<TResult> Zip<TSource1, TSource2, TResult>(this IQbservable<TSource1> first, IEnumerable<TSource2> second, Expression<Func<TSource1, TSource2, TResult>> resultSelector)
+        public static IQbservable<TResult> Zip<TSource1, TSource2, TResult>(this IQbservable<TSource1> first, IObservable<TSource2> second, Expression<Func<TSource1, TSource2, TResult>> resultSelector)
         {
         {
             if (first == null)
             if (first == null)
                 throw new ArgumentNullException("first");
                 throw new ArgumentNullException("first");
@@ -16700,7 +16845,7 @@ namespace System.Reactive.Linq
                 Expression.Call(
                 Expression.Call(
                     null,
                     null,
 #if CRIPPLED_REFLECTION
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Zip<TSource1, TSource2, TResult>(default(IQbservable<TSource1>), default(IEnumerable<TSource2>), default(Expression<Func<TSource1, TSource2, TResult>>))),
+                    InfoOf(() => Qbservable.Zip<TSource1, TSource2, TResult>(default(IQbservable<TSource1>), default(IObservable<TSource2>), default(Expression<Func<TSource1, TSource2, TResult>>))),
 #else
 #else
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
                     ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
 #endif
 #endif

+ 10 - 0
Rx.NET/Source/Tests.System.Reactive/Dummies/DummyFunc.cs

@@ -19,6 +19,16 @@ namespace ReactiveTests.Dummies
         public static readonly Func<T, U, V> Instance = (t, u) => { throw new NotImplementedException(); };
         public static readonly Func<T, U, V> Instance = (t, u) => { throw new NotImplementedException(); };
     }
     }
 
 
+    static class DummyFunc<T, U, V, W>
+    {
+        public static readonly Func<T, U, V, W> Instance = (t, u, v) => { throw new NotImplementedException(); };
+    }
+
+    static class DummyFunc<T, U, V, W, X>
+    {
+        public static readonly Func<T, U, V, W, X> Instance = (t, u, v, w) => { throw new NotImplementedException(); };
+    }
+
     static class DummyAction
     static class DummyAction
     {
     {
         public static readonly Action Instance = () => { throw new NotImplementedException(); };
         public static readonly Action Instance = () => { throw new NotImplementedException(); };

文件差异内容过多而无法显示
+ 511 - 310
Rx.NET/Source/Tests.System.Reactive/Tests/Linq/ObservableStandardQueryOperatorTest.cs


+ 2 - 2
Rx.NET/tools/HomoIcon/Program.cs

@@ -50,14 +50,14 @@ namespace HomoIconize
                 return;
                 return;
             }
             }
 
 
-            var dll = Path.Combine(rxRoot, @"bin\debug40\" + sourceAssembly + ".dll");
+            var dll = Path.Combine(rxRoot, @"..\bin\debug40\" + sourceAssembly + ".dll");
             if (!File.Exists(dll))
             if (!File.Exists(dll))
             {
             {
                 Console.WriteLine("Error:  Could not find file \"" + dll + "\"");
                 Console.WriteLine("Error:  Could not find file \"" + dll + "\"");
                 return;
                 return;
             }
             }
 
 
-            var xml = Path.Combine(rxRoot, @"bin\debug40\" + sourceAssembly + ".xml");
+            var xml = Path.Combine(rxRoot, @"..\bin\debug40\" + sourceAssembly + ".xml");
             if (!File.Exists(xml))
             if (!File.Exists(xml))
             {
             {
                 Console.WriteLine("Error:  Could not find file \"" + xml + "\"");
                 Console.WriteLine("Error:  Could not find file \"" + xml + "\"");

部分文件因为文件数量过多而无法显示