QueryablePattern.cs 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #pragma warning disable 1591
  3. using System.Linq.Expressions;
  4. using System.Reactive.Linq;
  5. namespace System.Reactive.Joins
  6. {
  7. /// <summary>
  8. /// Abstract base class for join patterns represented by an expression tree.
  9. /// </summary>
  10. public abstract class QueryablePattern
  11. {
  12. /// <summary>
  13. /// Creates a new join pattern object using the specified expression tree represention.
  14. /// </summary>
  15. /// <param name="expression">Expression tree representing the join pattern.</param>
  16. protected QueryablePattern(Expression expression)
  17. {
  18. Expression = expression;
  19. }
  20. /// <summary>
  21. /// Gets the expression tree representing the join pattern.
  22. /// </summary>
  23. public Expression Expression { get; private set; }
  24. }
  25. /* The following code is generated by a tool checked in to $/.../Source/Tools/CodeGenerators. */
  26. #region Joins auto-generated code (8/4/2012 1:00:32 AM)
  27. /// <summary>
  28. /// Represents a join pattern over two observable sequences.
  29. /// </summary>
  30. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  31. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  32. public class QueryablePattern<TSource1, TSource2> : QueryablePattern
  33. {
  34. internal QueryablePattern(Expression expression)
  35. : base(expression)
  36. {
  37. }
  38. /// <summary>
  39. /// Creates a pattern that matches when all three observable sequences have an available element.
  40. /// </summary>
  41. /// <typeparam name="TSource3">The type of the elements in the third observable sequence.</typeparam>
  42. /// <param name="other">Observable sequence to match with the two previous sequences.</param>
  43. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  44. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  45. public QueryablePattern<TSource1, TSource2, TSource3> And<TSource3>(IObservable<TSource3> other)
  46. {
  47. if (other == null)
  48. throw new ArgumentNullException("other");
  49. var t = typeof(QueryablePattern<TSource1, TSource2>);
  50. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource3));
  51. return new QueryablePattern<TSource1, TSource2, TSource3>(
  52. Expression.Call(
  53. Expression,
  54. m,
  55. Qbservable.GetSourceExpression(other)
  56. )
  57. );
  58. }
  59. /// <summary>
  60. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  61. /// </summary>
  62. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  63. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  64. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  65. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  66. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TResult>> selector)
  67. {
  68. if (selector == null)
  69. throw new ArgumentNullException("selector");
  70. var t = typeof(QueryablePattern<TSource1, TSource2>);
  71. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  72. return new QueryablePlan<TResult>(
  73. Expression.Call(
  74. Expression,
  75. m,
  76. selector
  77. )
  78. );
  79. }
  80. }
  81. /// <summary>
  82. /// Represents a join pattern over three observable sequences.
  83. /// </summary>
  84. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  85. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  86. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  87. public class QueryablePattern<TSource1, TSource2, TSource3> : QueryablePattern
  88. {
  89. internal QueryablePattern(Expression expression)
  90. : base(expression)
  91. {
  92. }
  93. /// <summary>
  94. /// Creates a pattern that matches when all four observable sequences have an available element.
  95. /// </summary>
  96. /// <typeparam name="TSource4">The type of the elements in the fourth observable sequence.</typeparam>
  97. /// <param name="other">Observable sequence to match with the three previous sequences.</param>
  98. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  99. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  100. public QueryablePattern<TSource1, TSource2, TSource3, TSource4> And<TSource4>(IObservable<TSource4> other)
  101. {
  102. if (other == null)
  103. throw new ArgumentNullException("other");
  104. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3>);
  105. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource4));
  106. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4>(
  107. Expression.Call(
  108. Expression,
  109. m,
  110. Qbservable.GetSourceExpression(other)
  111. )
  112. );
  113. }
  114. /// <summary>
  115. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  116. /// </summary>
  117. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  118. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  119. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  120. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  121. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TResult>> selector)
  122. {
  123. if (selector == null)
  124. throw new ArgumentNullException("selector");
  125. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3>);
  126. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  127. return new QueryablePlan<TResult>(
  128. Expression.Call(
  129. Expression,
  130. m,
  131. selector
  132. )
  133. );
  134. }
  135. }
  136. /// <summary>
  137. /// Represents a join pattern over four observable sequences.
  138. /// </summary>
  139. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  140. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  141. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  142. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  143. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4> : QueryablePattern
  144. {
  145. internal QueryablePattern(Expression expression)
  146. : base(expression)
  147. {
  148. }
  149. #if !NO_LARGEARITY
  150. /// <summary>
  151. /// Creates a pattern that matches when all five observable sequences have an available element.
  152. /// </summary>
  153. /// <typeparam name="TSource5">The type of the elements in the fifth observable sequence.</typeparam>
  154. /// <param name="other">Observable sequence to match with the four previous sequences.</param>
  155. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  156. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  157. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5> And<TSource5>(IObservable<TSource5> other)
  158. {
  159. if (other == null)
  160. throw new ArgumentNullException("other");
  161. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4>);
  162. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource5));
  163. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5>(
  164. Expression.Call(
  165. Expression,
  166. m,
  167. Qbservable.GetSourceExpression(other)
  168. )
  169. );
  170. }
  171. #endif
  172. /// <summary>
  173. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  174. /// </summary>
  175. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  176. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  177. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  178. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  179. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TResult>> selector)
  180. {
  181. if (selector == null)
  182. throw new ArgumentNullException("selector");
  183. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4>);
  184. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  185. return new QueryablePlan<TResult>(
  186. Expression.Call(
  187. Expression,
  188. m,
  189. selector
  190. )
  191. );
  192. }
  193. }
  194. #if !NO_LARGEARITY
  195. /// <summary>
  196. /// Represents a join pattern over five observable sequences.
  197. /// </summary>
  198. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  199. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  200. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  201. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  202. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  203. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5> : QueryablePattern
  204. {
  205. internal QueryablePattern(Expression expression)
  206. : base(expression)
  207. {
  208. }
  209. /// <summary>
  210. /// Creates a pattern that matches when all six observable sequences have an available element.
  211. /// </summary>
  212. /// <typeparam name="TSource6">The type of the elements in the sixth observable sequence.</typeparam>
  213. /// <param name="other">Observable sequence to match with the five previous sequences.</param>
  214. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  215. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  216. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6> And<TSource6>(IObservable<TSource6> other)
  217. {
  218. if (other == null)
  219. throw new ArgumentNullException("other");
  220. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5>);
  221. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource6));
  222. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6>(
  223. Expression.Call(
  224. Expression,
  225. m,
  226. Qbservable.GetSourceExpression(other)
  227. )
  228. );
  229. }
  230. /// <summary>
  231. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  232. /// </summary>
  233. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  234. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  235. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  236. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  237. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>> selector)
  238. {
  239. if (selector == null)
  240. throw new ArgumentNullException("selector");
  241. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5>);
  242. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  243. return new QueryablePlan<TResult>(
  244. Expression.Call(
  245. Expression,
  246. m,
  247. selector
  248. )
  249. );
  250. }
  251. }
  252. /// <summary>
  253. /// Represents a join pattern over six observable sequences.
  254. /// </summary>
  255. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  256. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  257. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  258. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  259. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  260. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  261. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6> : QueryablePattern
  262. {
  263. internal QueryablePattern(Expression expression)
  264. : base(expression)
  265. {
  266. }
  267. /// <summary>
  268. /// Creates a pattern that matches when all seven observable sequences have an available element.
  269. /// </summary>
  270. /// <typeparam name="TSource7">The type of the elements in the seventh observable sequence.</typeparam>
  271. /// <param name="other">Observable sequence to match with the six previous sequences.</param>
  272. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  273. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  274. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7> And<TSource7>(IObservable<TSource7> other)
  275. {
  276. if (other == null)
  277. throw new ArgumentNullException("other");
  278. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6>);
  279. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource7));
  280. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7>(
  281. Expression.Call(
  282. Expression,
  283. m,
  284. Qbservable.GetSourceExpression(other)
  285. )
  286. );
  287. }
  288. /// <summary>
  289. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  290. /// </summary>
  291. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  292. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  293. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  294. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  295. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>> selector)
  296. {
  297. if (selector == null)
  298. throw new ArgumentNullException("selector");
  299. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6>);
  300. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  301. return new QueryablePlan<TResult>(
  302. Expression.Call(
  303. Expression,
  304. m,
  305. selector
  306. )
  307. );
  308. }
  309. }
  310. /// <summary>
  311. /// Represents a join pattern over seven observable sequences.
  312. /// </summary>
  313. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  314. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  315. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  316. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  317. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  318. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  319. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  320. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7> : QueryablePattern
  321. {
  322. internal QueryablePattern(Expression expression)
  323. : base(expression)
  324. {
  325. }
  326. /// <summary>
  327. /// Creates a pattern that matches when all eight observable sequences have an available element.
  328. /// </summary>
  329. /// <typeparam name="TSource8">The type of the elements in the eighth observable sequence.</typeparam>
  330. /// <param name="other">Observable sequence to match with the seven previous sequences.</param>
  331. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  332. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  333. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8> And<TSource8>(IObservable<TSource8> other)
  334. {
  335. if (other == null)
  336. throw new ArgumentNullException("other");
  337. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7>);
  338. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource8));
  339. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8>(
  340. Expression.Call(
  341. Expression,
  342. m,
  343. Qbservable.GetSourceExpression(other)
  344. )
  345. );
  346. }
  347. /// <summary>
  348. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  349. /// </summary>
  350. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  351. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  352. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  353. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  354. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>> selector)
  355. {
  356. if (selector == null)
  357. throw new ArgumentNullException("selector");
  358. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7>);
  359. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  360. return new QueryablePlan<TResult>(
  361. Expression.Call(
  362. Expression,
  363. m,
  364. selector
  365. )
  366. );
  367. }
  368. }
  369. /// <summary>
  370. /// Represents a join pattern over eight observable sequences.
  371. /// </summary>
  372. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  373. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  374. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  375. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  376. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  377. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  378. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  379. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  380. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8> : QueryablePattern
  381. {
  382. internal QueryablePattern(Expression expression)
  383. : base(expression)
  384. {
  385. }
  386. /// <summary>
  387. /// Creates a pattern that matches when all nine observable sequences have an available element.
  388. /// </summary>
  389. /// <typeparam name="TSource9">The type of the elements in the ninth observable sequence.</typeparam>
  390. /// <param name="other">Observable sequence to match with the eight previous sequences.</param>
  391. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  392. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  393. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9> And<TSource9>(IObservable<TSource9> other)
  394. {
  395. if (other == null)
  396. throw new ArgumentNullException("other");
  397. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8>);
  398. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource9));
  399. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9>(
  400. Expression.Call(
  401. Expression,
  402. m,
  403. Qbservable.GetSourceExpression(other)
  404. )
  405. );
  406. }
  407. /// <summary>
  408. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  409. /// </summary>
  410. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  411. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  412. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  413. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  414. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>> selector)
  415. {
  416. if (selector == null)
  417. throw new ArgumentNullException("selector");
  418. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8>);
  419. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  420. return new QueryablePlan<TResult>(
  421. Expression.Call(
  422. Expression,
  423. m,
  424. selector
  425. )
  426. );
  427. }
  428. }
  429. /// <summary>
  430. /// Represents a join pattern over nine observable sequences.
  431. /// </summary>
  432. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  433. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  434. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  435. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  436. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  437. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  438. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  439. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  440. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  441. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9> : QueryablePattern
  442. {
  443. internal QueryablePattern(Expression expression)
  444. : base(expression)
  445. {
  446. }
  447. /// <summary>
  448. /// Creates a pattern that matches when all ten observable sequences have an available element.
  449. /// </summary>
  450. /// <typeparam name="TSource10">The type of the elements in the tenth observable sequence.</typeparam>
  451. /// <param name="other">Observable sequence to match with the nine previous sequences.</param>
  452. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  453. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  454. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10> And<TSource10>(IObservable<TSource10> other)
  455. {
  456. if (other == null)
  457. throw new ArgumentNullException("other");
  458. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9>);
  459. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource10));
  460. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10>(
  461. Expression.Call(
  462. Expression,
  463. m,
  464. Qbservable.GetSourceExpression(other)
  465. )
  466. );
  467. }
  468. /// <summary>
  469. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  470. /// </summary>
  471. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  472. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  473. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  474. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  475. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>> selector)
  476. {
  477. if (selector == null)
  478. throw new ArgumentNullException("selector");
  479. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9>);
  480. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  481. return new QueryablePlan<TResult>(
  482. Expression.Call(
  483. Expression,
  484. m,
  485. selector
  486. )
  487. );
  488. }
  489. }
  490. /// <summary>
  491. /// Represents a join pattern over ten observable sequences.
  492. /// </summary>
  493. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  494. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  495. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  496. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  497. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  498. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  499. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  500. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  501. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  502. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  503. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10> : QueryablePattern
  504. {
  505. internal QueryablePattern(Expression expression)
  506. : base(expression)
  507. {
  508. }
  509. /// <summary>
  510. /// Creates a pattern that matches when all eleven observable sequences have an available element.
  511. /// </summary>
  512. /// <typeparam name="TSource11">The type of the elements in the eleventh observable sequence.</typeparam>
  513. /// <param name="other">Observable sequence to match with the ten previous sequences.</param>
  514. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  515. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  516. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11> And<TSource11>(IObservable<TSource11> other)
  517. {
  518. if (other == null)
  519. throw new ArgumentNullException("other");
  520. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10>);
  521. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource11));
  522. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11>(
  523. Expression.Call(
  524. Expression,
  525. m,
  526. Qbservable.GetSourceExpression(other)
  527. )
  528. );
  529. }
  530. /// <summary>
  531. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  532. /// </summary>
  533. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  534. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  535. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  536. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  537. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>> selector)
  538. {
  539. if (selector == null)
  540. throw new ArgumentNullException("selector");
  541. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10>);
  542. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  543. return new QueryablePlan<TResult>(
  544. Expression.Call(
  545. Expression,
  546. m,
  547. selector
  548. )
  549. );
  550. }
  551. }
  552. /// <summary>
  553. /// Represents a join pattern over eleven observable sequences.
  554. /// </summary>
  555. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  556. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  557. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  558. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  559. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  560. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  561. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  562. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  563. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  564. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  565. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  566. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11> : QueryablePattern
  567. {
  568. internal QueryablePattern(Expression expression)
  569. : base(expression)
  570. {
  571. }
  572. /// <summary>
  573. /// Creates a pattern that matches when all twelve observable sequences have an available element.
  574. /// </summary>
  575. /// <typeparam name="TSource12">The type of the elements in the twelfth observable sequence.</typeparam>
  576. /// <param name="other">Observable sequence to match with the eleven previous sequences.</param>
  577. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  578. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  579. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12> And<TSource12>(IObservable<TSource12> other)
  580. {
  581. if (other == null)
  582. throw new ArgumentNullException("other");
  583. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11>);
  584. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource12));
  585. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12>(
  586. Expression.Call(
  587. Expression,
  588. m,
  589. Qbservable.GetSourceExpression(other)
  590. )
  591. );
  592. }
  593. /// <summary>
  594. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  595. /// </summary>
  596. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  597. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  598. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  599. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  600. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>> selector)
  601. {
  602. if (selector == null)
  603. throw new ArgumentNullException("selector");
  604. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11>);
  605. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  606. return new QueryablePlan<TResult>(
  607. Expression.Call(
  608. Expression,
  609. m,
  610. selector
  611. )
  612. );
  613. }
  614. }
  615. /// <summary>
  616. /// Represents a join pattern over twelve observable sequences.
  617. /// </summary>
  618. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  619. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  620. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  621. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  622. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  623. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  624. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  625. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  626. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  627. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  628. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  629. /// <typeparam name="TSource12">The type of the elements in the twelfth source sequence.</typeparam>
  630. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12> : QueryablePattern
  631. {
  632. internal QueryablePattern(Expression expression)
  633. : base(expression)
  634. {
  635. }
  636. /// <summary>
  637. /// Creates a pattern that matches when all thirteen observable sequences have an available element.
  638. /// </summary>
  639. /// <typeparam name="TSource13">The type of the elements in the thirteenth observable sequence.</typeparam>
  640. /// <param name="other">Observable sequence to match with the twelve previous sequences.</param>
  641. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  642. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  643. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13> And<TSource13>(IObservable<TSource13> other)
  644. {
  645. if (other == null)
  646. throw new ArgumentNullException("other");
  647. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12>);
  648. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource13));
  649. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13>(
  650. Expression.Call(
  651. Expression,
  652. m,
  653. Qbservable.GetSourceExpression(other)
  654. )
  655. );
  656. }
  657. /// <summary>
  658. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  659. /// </summary>
  660. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  661. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  662. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  663. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  664. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>> selector)
  665. {
  666. if (selector == null)
  667. throw new ArgumentNullException("selector");
  668. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12>);
  669. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  670. return new QueryablePlan<TResult>(
  671. Expression.Call(
  672. Expression,
  673. m,
  674. selector
  675. )
  676. );
  677. }
  678. }
  679. /// <summary>
  680. /// Represents a join pattern over thirteen observable sequences.
  681. /// </summary>
  682. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  683. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  684. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  685. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  686. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  687. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  688. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  689. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  690. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  691. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  692. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  693. /// <typeparam name="TSource12">The type of the elements in the twelfth source sequence.</typeparam>
  694. /// <typeparam name="TSource13">The type of the elements in the thirteenth source sequence.</typeparam>
  695. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13> : QueryablePattern
  696. {
  697. internal QueryablePattern(Expression expression)
  698. : base(expression)
  699. {
  700. }
  701. /// <summary>
  702. /// Creates a pattern that matches when all fourteen observable sequences have an available element.
  703. /// </summary>
  704. /// <typeparam name="TSource14">The type of the elements in the fourteenth observable sequence.</typeparam>
  705. /// <param name="other">Observable sequence to match with the thirteen previous sequences.</param>
  706. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  707. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  708. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14> And<TSource14>(IObservable<TSource14> other)
  709. {
  710. if (other == null)
  711. throw new ArgumentNullException("other");
  712. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13>);
  713. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource14));
  714. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14>(
  715. Expression.Call(
  716. Expression,
  717. m,
  718. Qbservable.GetSourceExpression(other)
  719. )
  720. );
  721. }
  722. /// <summary>
  723. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  724. /// </summary>
  725. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  726. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  727. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  728. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  729. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>> selector)
  730. {
  731. if (selector == null)
  732. throw new ArgumentNullException("selector");
  733. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13>);
  734. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  735. return new QueryablePlan<TResult>(
  736. Expression.Call(
  737. Expression,
  738. m,
  739. selector
  740. )
  741. );
  742. }
  743. }
  744. /// <summary>
  745. /// Represents a join pattern over fourteen observable sequences.
  746. /// </summary>
  747. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  748. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  749. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  750. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  751. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  752. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  753. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  754. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  755. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  756. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  757. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  758. /// <typeparam name="TSource12">The type of the elements in the twelfth source sequence.</typeparam>
  759. /// <typeparam name="TSource13">The type of the elements in the thirteenth source sequence.</typeparam>
  760. /// <typeparam name="TSource14">The type of the elements in the fourteenth source sequence.</typeparam>
  761. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14> : QueryablePattern
  762. {
  763. internal QueryablePattern(Expression expression)
  764. : base(expression)
  765. {
  766. }
  767. /// <summary>
  768. /// Creates a pattern that matches when all fifteen observable sequences have an available element.
  769. /// </summary>
  770. /// <typeparam name="TSource15">The type of the elements in the fifteenth observable sequence.</typeparam>
  771. /// <param name="other">Observable sequence to match with the fourteen previous sequences.</param>
  772. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  773. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  774. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15> And<TSource15>(IObservable<TSource15> other)
  775. {
  776. if (other == null)
  777. throw new ArgumentNullException("other");
  778. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14>);
  779. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource15));
  780. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15>(
  781. Expression.Call(
  782. Expression,
  783. m,
  784. Qbservable.GetSourceExpression(other)
  785. )
  786. );
  787. }
  788. /// <summary>
  789. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  790. /// </summary>
  791. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  792. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  793. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  794. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  795. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>> selector)
  796. {
  797. if (selector == null)
  798. throw new ArgumentNullException("selector");
  799. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14>);
  800. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  801. return new QueryablePlan<TResult>(
  802. Expression.Call(
  803. Expression,
  804. m,
  805. selector
  806. )
  807. );
  808. }
  809. }
  810. /// <summary>
  811. /// Represents a join pattern over fifteen observable sequences.
  812. /// </summary>
  813. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  814. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  815. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  816. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  817. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  818. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  819. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  820. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  821. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  822. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  823. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  824. /// <typeparam name="TSource12">The type of the elements in the twelfth source sequence.</typeparam>
  825. /// <typeparam name="TSource13">The type of the elements in the thirteenth source sequence.</typeparam>
  826. /// <typeparam name="TSource14">The type of the elements in the fourteenth source sequence.</typeparam>
  827. /// <typeparam name="TSource15">The type of the elements in the fifteenth source sequence.</typeparam>
  828. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15> : QueryablePattern
  829. {
  830. internal QueryablePattern(Expression expression)
  831. : base(expression)
  832. {
  833. }
  834. /// <summary>
  835. /// Creates a pattern that matches when all sixteen observable sequences have an available element.
  836. /// </summary>
  837. /// <typeparam name="TSource16">The type of the elements in the sixteenth observable sequence.</typeparam>
  838. /// <param name="other">Observable sequence to match with the fifteen previous sequences.</param>
  839. /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>
  840. /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception>
  841. public QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16> And<TSource16>(IObservable<TSource16> other)
  842. {
  843. if (other == null)
  844. throw new ArgumentNullException("other");
  845. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15>);
  846. var m = t.GetMethod("And").MakeGenericMethod(typeof(TSource16));
  847. return new QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16>(
  848. Expression.Call(
  849. Expression,
  850. m,
  851. Qbservable.GetSourceExpression(other)
  852. )
  853. );
  854. }
  855. /// <summary>
  856. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  857. /// </summary>
  858. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  859. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  860. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  861. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  862. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>> selector)
  863. {
  864. if (selector == null)
  865. throw new ArgumentNullException("selector");
  866. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15>);
  867. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  868. return new QueryablePlan<TResult>(
  869. Expression.Call(
  870. Expression,
  871. m,
  872. selector
  873. )
  874. );
  875. }
  876. }
  877. /// <summary>
  878. /// Represents a join pattern over sixteen observable sequences.
  879. /// </summary>
  880. /// <typeparam name="TSource1">The type of the elements in the first source sequence.</typeparam>
  881. /// <typeparam name="TSource2">The type of the elements in the second source sequence.</typeparam>
  882. /// <typeparam name="TSource3">The type of the elements in the third source sequence.</typeparam>
  883. /// <typeparam name="TSource4">The type of the elements in the fourth source sequence.</typeparam>
  884. /// <typeparam name="TSource5">The type of the elements in the fifth source sequence.</typeparam>
  885. /// <typeparam name="TSource6">The type of the elements in the sixth source sequence.</typeparam>
  886. /// <typeparam name="TSource7">The type of the elements in the seventh source sequence.</typeparam>
  887. /// <typeparam name="TSource8">The type of the elements in the eighth source sequence.</typeparam>
  888. /// <typeparam name="TSource9">The type of the elements in the ninth source sequence.</typeparam>
  889. /// <typeparam name="TSource10">The type of the elements in the tenth source sequence.</typeparam>
  890. /// <typeparam name="TSource11">The type of the elements in the eleventh source sequence.</typeparam>
  891. /// <typeparam name="TSource12">The type of the elements in the twelfth source sequence.</typeparam>
  892. /// <typeparam name="TSource13">The type of the elements in the thirteenth source sequence.</typeparam>
  893. /// <typeparam name="TSource14">The type of the elements in the fourteenth source sequence.</typeparam>
  894. /// <typeparam name="TSource15">The type of the elements in the fifteenth source sequence.</typeparam>
  895. /// <typeparam name="TSource16">The type of the elements in the sixteenth source sequence.</typeparam>
  896. public class QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16> : QueryablePattern
  897. {
  898. internal QueryablePattern(Expression expression)
  899. : base(expression)
  900. {
  901. }
  902. /// <summary>
  903. /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.
  904. /// </summary>
  905. /// <typeparam name="TResult">The type of the elements in the result sequence, returned by the selector function.</typeparam>
  906. /// <param name="selector">Selector that will be invoked for elements in the source sequences.</param>
  907. /// <returns>Plan that produces the projected results, to be fed (with other plans) to the When operator.</returns>
  908. /// <exception cref="ArgumentNullException"><paramref name="selector"/> is null.</exception>
  909. public QueryablePlan<TResult> Then<TResult>(Expression<Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>> selector)
  910. {
  911. if (selector == null)
  912. throw new ArgumentNullException("selector");
  913. var t = typeof(QueryablePattern<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16>);
  914. var m = t.GetMethod("Then").MakeGenericMethod(typeof(TResult));
  915. return new QueryablePlan<TResult>(
  916. Expression.Call(
  917. Expression,
  918. m,
  919. selector
  920. )
  921. );
  922. }
  923. }
  924. #endif
  925. #endregion
  926. }
  927. #pragma warning restore 1591