Debian Codegraph @

external/rx/Rx/NET/Source/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs

raw
1 /*
2 * WARNING: Auto-generated file (11/21/2013 11:07:25 AM)
3 * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
4 */
5
6 #pragma warning disable 1591
7
8 #if !NO_EXPRESSIONS
9
10 using System;
11 using System.Reactive.Concurrency;
12 using System.Collections.Generic;
13 using System.Reactive.Joins;
14 using System.Linq;
15 using System.Linq.Expressions;
16 using System.Reflection;
17 using System.Threading;
18 using System.Reactive;
19 using System.Reactive.Subjects;
20 #if !NO_TPL
21 using System.Threading.Tasks;
22 #endif
23 #if !NO_REMOTING
24 using System.Runtime.Remoting.Lifetime;
25 #endif
26
27 namespace System.Reactive.Linq
28 {
29 public static partial class QbservableAliases
30 {
31 /// <summary>
32 /// Filters the elements of an observable sequence based on a predicate.
33 /// Synonym for the method 'Where'
34 /// </summary>
35 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
36 /// <param name="source">An observable sequence whose elements to filter.</param>
37 /// <param name="predicate">A function to test each source element for a condition.</param>
38 /// <returns>An observable sequence that contains elements from the input sequence that satisfy the condition.</returns>
39 /// <exception cref="T:System.ArgumentNullException">
40 /// <paramref name="source" /> or <paramref name="predicate" /> is null.</exception>
41 public static IQbservable<TSource> Filter<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)
42 {
43 return Qbservable.Where<TSource>(source, predicate);
44 }
45
46 /// <summary>
47 /// Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
48 /// Synonym for the method 'Where'
49 /// </summary>
50 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
51 /// <param name="source">An observable sequence whose elements to filter.</param>
52 /// <param name="predicate">A function to test each source element for a conditio; the second parameter of the function represents the index of the source element.</param>
53 /// <returns>An observable sequence that contains elements from the input sequence that satisfy the condition.</returns>
54 /// <exception cref="T:System.ArgumentNullException">
55 /// <paramref name="source" /> or <paramref name="predicate" /> is null.</exception>
56 public static IQbservable<TSource> Filter<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
57 {
58 return Qbservable.Where<TSource>(source, predicate);
59 }
60
61 /// <summary>
62 /// 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.
63 /// Synonym for the method 'SelectMany'
64 /// </summary>
65 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
66 /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
67 /// <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>
68 /// <param name="source">An observable sequence of elements to project.</param>
69 /// <param name="collectionSelector">A transform function to apply to each element.</param>
70 /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
71 /// <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>
72 /// <exception cref="T:System.ArgumentNullException">
73 /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
74 public static IQbservable<TResult> FlatMap<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
75 {
76 return Qbservable.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
77 }
78
79 /// <summary>
80 /// 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.
81 /// Synonym for the method 'SelectMany'
82 /// </summary>
83 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
84 /// <typeparam name="TCollection">The type of the elements in the projected intermediate sequences.</typeparam>
85 /// <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>
86 /// <param name="source">An observable sequence of elements to project.</param>
87 /// <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>
88 /// <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>
89 /// <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>
90 /// <exception cref="T:System.ArgumentNullException">
91 /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
92 public static IQbservable<TResult> FlatMap<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector)
93 {
94 return Qbservable.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
95 }
96
97 /// <summary>
98 /// 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.
99 /// Synonym for the method 'SelectMany'
100 /// </summary>
101 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
102 /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
103 /// <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>
104 /// <param name="source">An observable sequence of elements to project.</param>
105 /// <param name="collectionSelector">A transform function to apply to each element.</param>
106 /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
107 /// <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>
108 /// <exception cref="T:System.ArgumentNullException">
109 /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
110 /// <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="M:System.Reactive.Linq.Observable.ToObservable``1(System.Collections.Generic.IEnumerable{``0})" /> conversion.</remarks>
111 public static IQbservable<TResult> FlatMap<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
112 {
113 return Qbservable.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
114 }
115
116 /// <summary>
117 /// 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.
118 /// Synonym for the method 'SelectMany'
119 /// </summary>
120 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
121 /// <typeparam name="TCollection">The type of the elements in the projected intermediate enumerable sequences.</typeparam>
122 /// <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>
123 /// <param name="source">An observable sequence of elements to project.</param>
124 /// <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>
125 /// <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>
126 /// <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>
127 /// <exception cref="T:System.ArgumentNullException">
128 /// <paramref name="source" /> or <paramref name="collectionSelector" /> or <paramref name="resultSelector" /> is null.</exception>
129 /// <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="M:System.Reactive.Linq.Observable.ToObservable``1(System.Collections.Generic.IEnumerable{``0})" /> conversion.</remarks>
130 public static IQbservable<TResult> FlatMap<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector)
131 {
132 return Qbservable.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
133 }
134
135 /// <summary>
136 /// Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
137 /// Synonym for the method 'SelectMany'
138 /// </summary>
139 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
140 /// <typeparam name="TOther">The type of the elements in the other sequence and the elements in the result sequence.</typeparam>
141 /// <param name="source">An observable sequence of elements to project.</param>
142 /// <param name="other">An observable sequence to project each element from the source sequence onto.</param>
143 /// <returns>An observable sequence whose elements are the result of projecting each source element onto the other sequence and merging all the resulting sequences together.</returns>
144 /// <exception cref="T:System.ArgumentNullException">
145 /// <paramref name="source" /> or <paramref name="other" /> is null.</exception>
146 public static IQbservable<TOther> FlatMap<TSource, TOther>(this IQbservable<TSource> source, IObservable<TOther> other)
147 {
148 return Qbservable.SelectMany<TSource, TOther>(source, other);
149 }
150
151 /// <summary>
152 /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
153 /// Synonym for the method 'SelectMany'
154 /// </summary>
155 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
156 /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
157 /// <param name="source">An observable sequence of notifications to project.</param>
158 /// <param name="onNext">A transform function to apply to each element.</param>
159 /// <param name="onError">A transform function to apply when an error occurs in the source sequence.</param>
160 /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached.</param>
161 /// <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>
162 /// <exception cref="T:System.ArgumentNullException">
163 /// <paramref name="source" /> or <paramref name="onNext" /> or <paramref name="onError" /> or <paramref name="onCompleted" /> is null.</exception>
164 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted)
165 {
166 return Qbservable.SelectMany<TSource, TResult>(source, onNext, onError, onCompleted);
167 }
168
169 /// <summary>
170 /// 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.
171 /// Synonym for the method 'SelectMany'
172 /// </summary>
173 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
174 /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
175 /// <param name="source">An observable sequence of notifications to project.</param>
176 /// <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>
177 /// <param name="onError">A transform function to apply when an error occurs in the source sequence.</param>
178 /// <param name="onCompleted">A transform function to apply when the end of the source sequence is reached.</param>
179 /// <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>
180 /// <exception cref="T:System.ArgumentNullException">
181 /// <paramref name="source" /> or <paramref name="onNext" /> or <paramref name="onError" /> or <paramref name="onCompleted" /> is null.</exception>
182 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted)
183 {
184 return Qbservable.SelectMany<TSource, TResult>(source, onNext, onError, onCompleted);
185 }
186
187 /// <summary>
188 /// Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
189 /// Synonym for the method 'SelectMany'
190 /// </summary>
191 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
192 /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
193 /// <param name="source">An observable sequence of elements to project.</param>
194 /// <param name="selector">A transform function to apply to each element.</param>
195 /// <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>
196 /// <exception cref="T:System.ArgumentNullException">
197 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
198 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> selector)
199 {
200 return Qbservable.SelectMany<TSource, TResult>(source, selector);
201 }
202
203 /// <summary>
204 /// 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.
205 /// Synonym for the method 'SelectMany'
206 /// </summary>
207 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
208 /// <typeparam name="TResult">The type of the elements in the projected inner sequences and the elements in the merged result sequence.</typeparam>
209 /// <param name="source">An observable sequence of elements to project.</param>
210 /// <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>
211 /// <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>
212 /// <exception cref="T:System.ArgumentNullException">
213 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
214 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> selector)
215 {
216 return Qbservable.SelectMany<TSource, TResult>(source, selector);
217 }
218
219 #if !NO_TPL
220 /// <summary>
221 /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
222 /// Synonym for the method 'SelectMany'
223 /// </summary>
224 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
225 /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
226 /// <param name="source">An observable sequence of elements to project.</param>
227 /// <param name="selector">A transform function to apply to each element.</param>
228 /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
229 /// <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>
230 /// <exception cref="T:System.ArgumentNullException">
231 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
232 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TResult>>> selector)
233 {
234 return Qbservable.SelectMany<TSource, TResult>(source, selector);
235 }
236 #endif
237
238 #if !NO_TPL
239 /// <summary>
240 /// 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.
241 /// Synonym for the method 'SelectMany'
242 /// </summary>
243 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
244 /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
245 /// <param name="source">An observable sequence of elements to project.</param>
246 /// <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>
247 /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
248 /// <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>
249 /// <exception cref="T:System.ArgumentNullException">
250 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
251 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TResult>>> selector)
252 {
253 return Qbservable.SelectMany<TSource, TResult>(source, selector);
254 }
255 #endif
256
257 #if !NO_TPL
258 /// <summary>
259 /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
260 /// Synonym for the method 'SelectMany'
261 /// </summary>
262 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
263 /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
264 /// <param name="source">An observable sequence of elements to project.</param>
265 /// <param name="selector">A transform function to apply to each element.</param>
266 /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
267 /// <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>
268 /// <exception cref="T:System.ArgumentNullException">
269 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
270 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TResult>>> selector)
271 {
272 return Qbservable.SelectMany<TSource, TResult>(source, selector);
273 }
274 #endif
275
276 #if !NO_TPL
277 /// <summary>
278 /// 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.
279 /// Synonym for the method 'SelectMany'
280 /// </summary>
281 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
282 /// <typeparam name="TResult">The type of the result produced by the projected tasks and the elements in the merged result sequence.</typeparam>
283 /// <param name="source">An observable sequence of elements to project.</param>
284 /// <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>
285 /// <returns>An observable sequence whose elements are the result of the tasks executed for each element of the input sequence.</returns>
286 /// <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>
287 /// <exception cref="T:System.ArgumentNullException">
288 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
289 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TResult>>> selector)
290 {
291 return Qbservable.SelectMany<TSource, TResult>(source, selector);
292 }
293 #endif
294
295 /// <summary>
296 /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
297 /// Synonym for the method 'SelectMany'
298 /// </summary>
299 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
300 /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
301 /// <param name="source">An observable sequence of elements to project.</param>
302 /// <param name="selector">A transform function to apply to each element.</param>
303 /// <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>
304 /// <exception cref="T:System.ArgumentNullException">
305 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
306 /// <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="M:System.Reactive.Linq.Observable.ToObservable``1(System.Collections.Generic.IEnumerable{``0})" /> conversion.</remarks>
307 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)
308 {
309 return Qbservable.SelectMany<TSource, TResult>(source, selector);
310 }
311
312 /// <summary>
313 /// 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.
314 /// Synonym for the method 'SelectMany'
315 /// </summary>
316 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
317 /// <typeparam name="TResult">The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence.</typeparam>
318 /// <param name="source">An observable sequence of elements to project.</param>
319 /// <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>
320 /// <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>
321 /// <exception cref="T:System.ArgumentNullException">
322 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
323 /// <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="M:System.Reactive.Linq.Observable.ToObservable``1(System.Collections.Generic.IEnumerable{``0})" /> conversion.</remarks>
324 public static IQbservable<TResult> FlatMap<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector)
325 {
326 return Qbservable.SelectMany<TSource, TResult>(source, selector);
327 }
328
329 #if !NO_TPL
330 /// <summary>
331 /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
332 /// Synonym for the method 'SelectMany'
333 /// </summary>
334 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
335 /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
336 /// <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>
337 /// <param name="source">An observable sequence of elements to project.</param>
338 /// <param name="taskSelector">A transform function to apply to each element.</param>
339 /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
340 /// <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>
341 /// <exception cref="T:System.ArgumentNullException">
342 /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
343 /// <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>
344 public static IQbservable<TResult> FlatMap<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector)
345 {
346 return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
347 }
348 #endif
349
350 #if !NO_TPL
351 /// <summary>
352 /// 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.
353 /// Synonym for the method 'SelectMany'
354 /// </summary>
355 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
356 /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
357 /// <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>
358 /// <param name="source">An observable sequence of elements to project.</param>
359 /// <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>
360 /// <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>
361 /// <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>
362 /// <exception cref="T:System.ArgumentNullException">
363 /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
364 /// <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>
365 public static IQbservable<TResult> FlatMap<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
366 {
367 return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
368 }
369 #endif
370
371 #if !NO_TPL
372 /// <summary>
373 /// 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.
374 /// Synonym for the method 'SelectMany'
375 /// </summary>
376 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
377 /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
378 /// <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>
379 /// <param name="source">An observable sequence of elements to project.</param>
380 /// <param name="taskSelector">A transform function to apply to each element.</param>
381 /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
382 /// <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>
383 /// <exception cref="T:System.ArgumentNullException">
384 /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
385 /// <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>
386 public static IQbservable<TResult> FlatMap<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector)
387 {
388 return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
389 }
390 #endif
391
392 #if !NO_TPL
393 /// <summary>
394 /// 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.
395 /// Synonym for the method 'SelectMany'
396 /// </summary>
397 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
398 /// <typeparam name="TTaskResult">The type of the results produced by the projected intermediate tasks.</typeparam>
399 /// <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>
400 /// <param name="source">An observable sequence of elements to project.</param>
401 /// <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>
402 /// <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>
403 /// <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>
404 /// <exception cref="T:System.ArgumentNullException">
405 /// <paramref name="source" /> or <paramref name="taskSelector" /> or <paramref name="resultSelector" /> is null.</exception>
406 /// <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>
407 public static IQbservable<TResult> FlatMap<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
408 {
409 return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
410 }
411 #endif
412
413 /// <summary>
414 /// Projects each element of an observable sequence into a new form. Synonym for the method 'Select'
415 /// </summary>
416 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
417 /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.</typeparam>
418 /// <param name="source">A sequence of elements to invoke a transform function on.</param>
419 /// <param name="selector">A transform function to apply to each source element.</param>
420 /// <returns>An observable sequence whose elements are the result of invoking the transform function on each element of source.</returns>
421 /// <exception cref="T:System.ArgumentNullException">
422 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
423 public static IQbservable<TResult> Map<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, TResult>> selector)
424 {
425 return Qbservable.Select<TSource, TResult>(source, selector);
426 }
427
428 /// <summary>
429 /// Projects each element of an observable sequence into a new form by incorporating the element's index. Synonym for the method 'Select'
430 /// </summary>
431 /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
432 /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.</typeparam>
433 /// <param name="source">A sequence of elements to invoke a transform function on.</param>
434 /// <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>
435 /// <returns>An observable sequence whose elements are the result of invoking the transform function on each element of source.</returns>
436 /// <exception cref="T:System.ArgumentNullException">
437 /// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
438 public static IQbservable<TResult> Map<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, TResult>> selector)
439 {
440 return Qbservable.Select<TSource, TResult>(source, selector);
441 }
442
443 }
444 }
445
446 #endif
447
448 #pragma warning restore 1591
449