1
0

Pattern.cs 67 KB

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