|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * WARNING: Auto-generated file (11/5/2013 1:54:09 PM)
|
|
|
+ * WARNING: Auto-generated file (11/18/2013 1:29:43 PM)
|
|
|
* Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
|
|
|
*/
|
|
|
|
|
@@ -11568,314 +11568,6 @@ namespace System.Reactive.Linq
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in ascending order according to a key.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="keySelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because time information is lost and notifications are only generated when the <paramref name="source" />
|
|
|
- /// sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderBy<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderBy<TSource, TKey>(default(IQbservable<TSource>), default(Expression<Func<TSource, TKey>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in ascending order by using a specified comparer.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <param name="comparer">An <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" />, <paramref name="keySelector" /> or <paramref name="comparer" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because timing is lost and notifications are only generated when the <paramref name="source" />
|
|
|
- /// sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderBy<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
- if (comparer == null)
|
|
|
- throw new ArgumentNullException("comparer");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderBy<TSource, TKey>(default(IQbservable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector,
|
|
|
- Expression.Constant(comparer, typeof(IComparer<TKey>))
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in ascending order according to the times at which corresponding observable sequences produce their first notification or complete.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TOther">The type of the elements in the observable returned by <paramref name="timeSelector" />.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="timeSelector">A function that returns an observable for an element in the <paramref name="source" /> sequence indicating the time at which that element should appear in the ordering.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to the times at which corresponding observable sequences produce their first notification or complete.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="timeSelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// This overload of OrderBy is similar to a particular usage of SelectMany where the elements in the <paramref name="source" /> sequence are returned based on the times
|
|
|
- /// at which their corresponding inner sequences produce their first notification or complete. Any elements in the inner sequences are discarded.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// The primary benefits of this overload of OrderBy is that it relates to ordering specifically, thus it's more semantic than SelectMany and it allows an author to avoid
|
|
|
- /// defining an unused query variable when applying SelectMany merely as an ordering operator. It also returns <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> so that it may
|
|
|
- /// be used in combination with any overloads of ThenBy and ThenByDescending to define queries that order by time and key.
|
|
|
- /// </para>
|
|
|
- /// <alert type="info">
|
|
|
- /// Unlike the other overload of OrderBy, this overload does not buffer any elements and it does not wait for the <paramref name="source" /> sequence to complete before it
|
|
|
- /// pushes notifications. This overload is entirely reactive.
|
|
|
- /// </alert>
|
|
|
- /// <para>
|
|
|
- /// This overload supports using the orderby LINQ query comprehension syntax in C# and Visual Basic by passing an observable sequence as the key.
|
|
|
- /// </para>
|
|
|
- /// <example>
|
|
|
- /// <para>
|
|
|
- /// The following example shows how to use this overload of OrderBy with the orderby LINQ query comprehension syntax in C#.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// The result of this query is a sequence of integers from 5 to 1, at 1 second intervals.
|
|
|
- /// </para>
|
|
|
- /// <code><![CDATA[IObservable<int> xs =
|
|
|
- /// from x in Observable.Range(1, 5)
|
|
|
- /// orderby Observable.Timer(TimeSpan.FromSeconds(5 - x))
|
|
|
- /// select x;]]></code>
|
|
|
- /// </example>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderBy<TSource, TOther>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TOther>>> timeSelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (timeSelector == null)
|
|
|
- throw new ArgumentNullException("timeSelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderBy<TSource, TOther>(default(IQbservable<TSource>), default(Expression<Func<TSource, IObservable<TOther>>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- timeSelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in descending order according to a key.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="keySelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because timing is lost and notifications are only generated when the <paramref name="source" />
|
|
|
- /// sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderByDescending<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderByDescending<TSource, TKey>(default(IQbservable<TSource>), default(Expression<Func<TSource, TKey>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in descending order by using a specified comparer.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <param name="comparer">An <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" />, <paramref name="keySelector" /> or <paramref name="comparer" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because timing is lost and notifications are only generated when the <paramref name="source" />
|
|
|
- /// sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderByDescending<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
- if (comparer == null)
|
|
|
- throw new ArgumentNullException("comparer");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderByDescending<TSource, TKey>(default(IQbservable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector,
|
|
|
- Expression.Constant(comparer, typeof(IComparer<TKey>))
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Sorts the elements of a sequence in descending order according to the times at which corresponding observable sequences produce their first notification or complete.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TOther">The type of the elements in the observable returned by <paramref name="timeSelector" />.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="timeSelector">A function that returns an observable for an element in the <paramref name="source" /> sequence indicating the time at which that element should appear in the ordering.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to the times at which corresponding observable sequences produce their first notification or complete.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="timeSelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering descending by time requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence descending by time is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because timing from the <paramref name="source" /> sequence is lost and notifications are only generated when
|
|
|
- /// the <paramref name="source" /> sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// <para>
|
|
|
- /// This overload of OrderByDescending is similar to a particular usage of SelectMany where the elements in the <paramref name="source" /> sequence are returned based on the times
|
|
|
- /// at which their corresponding inner sequences produce their first notification or complete. Any elements in the inner sequences are discarded.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// The primary benefits of this overload of OrderByDescending is that it relates to ordering specifically, thus it's more semantic than SelectMany and it allows an author to avoid
|
|
|
- /// defining an unused query variable when applying SelectMany merely as an ordering operator. It also returns <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> so that it may
|
|
|
- /// be used in combination with any overloads of ThenBy and ThenByDescending to define queries that order by time and key.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// This overload supports using the orderby LINQ query comprehension syntax in C# and Visual Basic by passing an observable sequence as the key.
|
|
|
- /// </para>
|
|
|
- /// <example>
|
|
|
- /// <para>
|
|
|
- /// The following example shows how to use this overload of OrderByDescending with the orderby LINQ query comprehension syntax in C#.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// The result of this query is a sequence of integers from 1 to 5, all of them arriving at 5 seconds from the time of subscription.
|
|
|
- /// </para>
|
|
|
- /// <code><![CDATA[IObservable<int> xs =
|
|
|
- /// from x in Observable.Range(1, 5)
|
|
|
- /// orderby Observable.Timer(TimeSpan.FromSeconds(5 - x)) descending
|
|
|
- /// select x;]]></code>
|
|
|
- /// </example>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> OrderByDescending<TSource, TOther>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TOther>>> timeSelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (timeSelector == null)
|
|
|
- throw new ArgumentNullException("timeSelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.OrderByDescending<TSource, TOther>(default(IQbservable<TSource>), default(Expression<Func<TSource, IObservable<TOther>>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- timeSelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
|
|
|
/// This operator is a specialization of Multicast using a regular <see cref="T:System.Reactive.Subjects.Subject`1" />.
|
|
@@ -16050,232 +15742,6 @@ namespace System.Reactive.Linq
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="keySelector" /> is <see langword="null" />.</exception>
|
|
|
- public static IOrderedQbservable<TSource> ThenBy<TSource, TKey>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenBy<TSource, TKey>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, TKey>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <param name="comparer">An <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" />, <paramref name="keySelector" /> or <paramref name="comparer" /> is <see langword="null" />.</exception>
|
|
|
- public static IOrderedQbservable<TSource> ThenBy<TSource, TKey>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
- if (comparer == null)
|
|
|
- throw new ArgumentNullException("comparer");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenBy<TSource, TKey>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector,
|
|
|
- Expression.Constant(comparer, typeof(IComparer<TKey>))
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in ascending order according to the times at which corresponding observable sequences produce their first notification or complete.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TOther">The type of the elements in the observable returned by <paramref name="timeSelector" />.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="timeSelector">A function that returns an observable for an element in the <paramref name="source" /> sequence indicating the time at which that element should appear in the ordering.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted according to the times at which corresponding observable sequences produce their first notification or complete.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="timeSelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// This overload of ThenBy is similar to a particular usage of SelectMany where the elements in the <paramref name="source" /> sequence are returned based on the times
|
|
|
- /// at which their corresponding inner sequences produce their first notification or complete. Any elements in the inner sequences are discarded.
|
|
|
- /// </para>
|
|
|
- /// <alert type="info">
|
|
|
- /// Unlike the other overload of ThenBy, this overload does not buffer any elements and it does not wait for the <paramref name="source" /> sequence to complete before it
|
|
|
- /// pushes notifications. This overload is entirely reactive.
|
|
|
- /// </alert>
|
|
|
- /// <para>
|
|
|
- /// This overload supports using the orderby LINQ query comprehension syntax in C# and Visual Basic by passing an observable sequence as a subsequent key.
|
|
|
- /// </para>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> ThenBy<TSource, TOther>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, IObservable<TOther>>> timeSelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (timeSelector == null)
|
|
|
- throw new ArgumentNullException("timeSelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenBy<TSource, TOther>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, IObservable<TOther>>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- timeSelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in descending order according to a key.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="keySelector" /> is <see langword="null" />.</exception>
|
|
|
- public static IOrderedQbservable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenByDescending<TSource, TKey>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, TKey>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TKey">The type of the sorting key computed for each element in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="keySelector">A function to extract the key for each element.</param>
|
|
|
- /// <param name="comparer">An <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to a key.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" />, <paramref name="keySelector" /> or <paramref name="comparer" /> is <see langword="null" />.</exception>
|
|
|
- public static IOrderedQbservable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (keySelector == null)
|
|
|
- throw new ArgumentNullException("keySelector");
|
|
|
- if (comparer == null)
|
|
|
- throw new ArgumentNullException("comparer");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenByDescending<TSource, TKey>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- keySelector,
|
|
|
- Expression.Constant(comparer, typeof(IComparer<TKey>))
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Performs a subsequent ordering of the elements in a sequence in descending order according to the times at which corresponding observable sequences produce their first notification or complete.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the <paramref name="source" /> sequence.</typeparam>
|
|
|
- /// <typeparam name="TOther">The type of the elements in the observable returned by <paramref name="timeSelector" />.</typeparam>
|
|
|
- /// <param name="source">An observable sequence of values to order.</param>
|
|
|
- /// <param name="timeSelector">A function that returns an observable for an element in the <paramref name="source" /> sequence indicating the time at which that element should appear in the ordering.</param>
|
|
|
- /// <returns>An <see cref="T:System.Reactive.Linq.IOrderedObservable`1" /> whose elements are sorted in descending order according to the times at which corresponding observable sequences produce their first notification or complete.</returns>
|
|
|
- /// <exception cref="T:System.ArgumentNullException">
|
|
|
- /// <paramref name="source" /> or <paramref name="timeSelector" /> is <see langword="null" />.</exception>
|
|
|
- /// <remarks>
|
|
|
- /// <para>
|
|
|
- /// Ordering descending by time requires all of the elements in the <paramref name="source" /> sequence to be observed before it can complete,
|
|
|
- /// which means that all of the elements must be buffered. Ordering an observable sequence descending by time is similar to performing an aggregation
|
|
|
- /// such as <see cref="M:System.Reactive.Linq.Observable.ToList``1(System.IObservable{``0})" /> because timing from the <paramref name="source" /> sequence is lost and notifications are only generated when
|
|
|
- /// the <paramref name="source" /> sequence calls OnCompleted.
|
|
|
- /// </para>
|
|
|
- /// <alert type="warn">
|
|
|
- /// Do not attempt to order an observable sequence that never calls OnCompleted. There will be no notifications generated, and it
|
|
|
- /// may result in an <see cref="T:System.OutOfMemoryException" /> being thrown.
|
|
|
- /// </alert>
|
|
|
- /// <para>
|
|
|
- /// This overload of ThenByDescending is similar to a particular usage of SelectMany where the elements in the <paramref name="source" /> sequence are returned based on the times
|
|
|
- /// at which their corresponding inner sequences produce their first notification or complete. Any elements in the inner sequences are discarded.
|
|
|
- /// </para>
|
|
|
- /// <para>
|
|
|
- /// This overload supports using the orderby LINQ query comprehension syntax in C# and Visual Basic by passing an observable sequence as a subsequent key.
|
|
|
- /// </para>
|
|
|
- /// </remarks>
|
|
|
- public static IOrderedQbservable<TSource> ThenByDescending<TSource, TOther>(this IOrderedQbservable<TSource> source, Expression<Func<TSource, IObservable<TOther>>> timeSelector)
|
|
|
- {
|
|
|
- if (source == null)
|
|
|
- throw new ArgumentNullException("source");
|
|
|
- if (timeSelector == null)
|
|
|
- throw new ArgumentNullException("timeSelector");
|
|
|
-
|
|
|
- return (IOrderedQbservable<TSource>)source.Provider.CreateQuery<TSource>(
|
|
|
- Expression.Call(
|
|
|
- null,
|
|
|
-#if CRIPPLED_REFLECTION
|
|
|
- InfoOf(() => Qbservable.ThenByDescending<TSource, TOther>(default(IOrderedQbservable<TSource>), default(Expression<Func<TSource, IObservable<TOther>>>))),
|
|
|
-#else
|
|
|
- ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)),
|
|
|
-#endif
|
|
|
- source.Expression,
|
|
|
- timeSelector
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Ignores elements from an observable sequence which are followed by another element within a specified relative time duration.
|
|
|
/// </summary>
|