QueryablePattern.cs 59 KB

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