Pattern.cs 67 KB

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