Pattern.cs 68 KB

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