QueryablePattern.cs 59 KB

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