PageRenderTime 16ms CodeModel.GetById 100ms app.highlight 329ms RepoModel.GetById 54ms app.codeStats 1ms

/System.Reactive/System.Reactive.Joins/System.Reactive.Joins.generated.cs

https://github.com/gshackles/mono-reactive
C# | 2489 lines | 2137 code | 346 blank | 6 comment | 1630 complexity | 0af2e3ecbc481ef17c659e45acba4bab MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1
   2using System;
   3using System.Collections.Generic;
   4using System.Linq;
   5using System.Linq.Expressions;
   6using System.Reactive;
   7using System.Reactive.Disposables;
   8using System.Reactive.Linq;
   9using System.Reactive.Subjects;
  10
  11namespace System.Reactive.Joins
  12{
  13
  14	public class Pattern<T1, T2> : Pattern
  15	{
  16		internal Pattern (IObservable<T1> t1, IObservable<T2> t2)
  17		{
  18			this.t1 = t1;
  19			this.t2 = t2;
  20		}
  21		
  22		IObservable<T1> t1;
  23		IObservable<T2> t2;
  24
  25
  26		
  27		public Pattern<T1, T2, T3> And<T3> (IObservable<T3> other)
  28		{
  29			return new Pattern<T1, T2, T3> (t1, t2, other);
  30		}
  31		
  32
  33		public Plan<TResult> Then<TResult> (Func<T1, T2, TResult> selector)
  34		{
  35			return new Plan<T1, T2, TResult> (this, selector);
  36		}
  37		
  38		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, TResult> selector)
  39		{
  40			var sub = new Subject<TResult> ();
  41			bool [] done = new bool [2];
  42			var q1 = new Queue<T1> ();
  43			var q2 = new Queue<T2> ();
  44
  45			
  46			t1.Subscribe (Observer.Create<T1> (t => {
  47				q1.Enqueue (t);
  48				if (q1.Count > 0 && q2.Count > 0)
  49					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue ()));
  50			}, (ex) => sub.OnError (ex), () => {
  51				done [0] = true;
  52				if (done.All (b => b))
  53					sub.OnCompleted ();
  54			}));
  55			
  56			t2.Subscribe (Observer.Create<T2> (t => {
  57				q2.Enqueue (t);
  58				if (q1.Count > 0 && q2.Count > 0)
  59					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue ()));
  60			}, (ex) => sub.OnError (ex), () => {
  61				done [1] = true;
  62				if (done.All (b => b))
  63					sub.OnCompleted ();
  64			}));
  65			
  66
  67			return sub;
  68		}
  69	}
  70	
  71	internal class Plan<T1, T2, TResult> : Plan<TResult>
  72	{
  73		Pattern<T1, T2> pattern;
  74		Func<T1, T2, TResult> selector;
  75		
  76		public Plan (Pattern<T1, T2> pattern, Func<T1, T2, TResult> selector)
  77		{
  78			this.pattern = pattern;
  79			this.selector = selector;
  80		}
  81		
  82		internal override IObservable<TResult> AsObservable ()
  83		{
  84			return pattern.AsObservable<TResult> (selector);
  85		}
  86	}
  87	
  88	public class Pattern<T1, T2, T3> : Pattern
  89	{
  90		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3)
  91		{
  92			this.t1 = t1;
  93			this.t2 = t2;
  94			this.t3 = t3;
  95		}
  96		
  97		IObservable<T1> t1;
  98		IObservable<T2> t2;
  99		IObservable<T3> t3;
 100
 101
 102		
 103		public Pattern<T1, T2, T3, T4> And<T4> (IObservable<T4> other)
 104		{
 105			return new Pattern<T1, T2, T3, T4> (t1, t2, t3, other);
 106		}
 107		
 108
 109		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, TResult> selector)
 110		{
 111			return new Plan<T1, T2, T3, TResult> (this, selector);
 112		}
 113		
 114		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, TResult> selector)
 115		{
 116			var sub = new Subject<TResult> ();
 117			bool [] done = new bool [3];
 118			var q1 = new Queue<T1> ();
 119			var q2 = new Queue<T2> ();
 120			var q3 = new Queue<T3> ();
 121
 122			
 123			t1.Subscribe (Observer.Create<T1> (t => {
 124				q1.Enqueue (t);
 125				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0)
 126					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue ()));
 127			}, (ex) => sub.OnError (ex), () => {
 128				done [0] = true;
 129				if (done.All (b => b))
 130					sub.OnCompleted ();
 131			}));
 132			
 133			t2.Subscribe (Observer.Create<T2> (t => {
 134				q2.Enqueue (t);
 135				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0)
 136					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue ()));
 137			}, (ex) => sub.OnError (ex), () => {
 138				done [1] = true;
 139				if (done.All (b => b))
 140					sub.OnCompleted ();
 141			}));
 142			
 143			t3.Subscribe (Observer.Create<T3> (t => {
 144				q3.Enqueue (t);
 145				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0)
 146					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue ()));
 147			}, (ex) => sub.OnError (ex), () => {
 148				done [2] = true;
 149				if (done.All (b => b))
 150					sub.OnCompleted ();
 151			}));
 152			
 153
 154			return sub;
 155		}
 156	}
 157	
 158	internal class Plan<T1, T2, T3, TResult> : Plan<TResult>
 159	{
 160		Pattern<T1, T2, T3> pattern;
 161		Func<T1, T2, T3, TResult> selector;
 162		
 163		public Plan (Pattern<T1, T2, T3> pattern, Func<T1, T2, T3, TResult> selector)
 164		{
 165			this.pattern = pattern;
 166			this.selector = selector;
 167		}
 168		
 169		internal override IObservable<TResult> AsObservable ()
 170		{
 171			return pattern.AsObservable<TResult> (selector);
 172		}
 173	}
 174	
 175	public class Pattern<T1, T2, T3, T4> : Pattern
 176	{
 177		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4)
 178		{
 179			this.t1 = t1;
 180			this.t2 = t2;
 181			this.t3 = t3;
 182			this.t4 = t4;
 183		}
 184		
 185		IObservable<T1> t1;
 186		IObservable<T2> t2;
 187		IObservable<T3> t3;
 188		IObservable<T4> t4;
 189
 190
 191		
 192		public Pattern<T1, T2, T3, T4, T5> And<T5> (IObservable<T5> other)
 193		{
 194			return new Pattern<T1, T2, T3, T4, T5> (t1, t2, t3, t4, other);
 195		}
 196		
 197
 198		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, TResult> selector)
 199		{
 200			return new Plan<T1, T2, T3, T4, TResult> (this, selector);
 201		}
 202		
 203		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, TResult> selector)
 204		{
 205			var sub = new Subject<TResult> ();
 206			bool [] done = new bool [4];
 207			var q1 = new Queue<T1> ();
 208			var q2 = new Queue<T2> ();
 209			var q3 = new Queue<T3> ();
 210			var q4 = new Queue<T4> ();
 211
 212			
 213			t1.Subscribe (Observer.Create<T1> (t => {
 214				q1.Enqueue (t);
 215				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0)
 216					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue ()));
 217			}, (ex) => sub.OnError (ex), () => {
 218				done [0] = true;
 219				if (done.All (b => b))
 220					sub.OnCompleted ();
 221			}));
 222			
 223			t2.Subscribe (Observer.Create<T2> (t => {
 224				q2.Enqueue (t);
 225				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0)
 226					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue ()));
 227			}, (ex) => sub.OnError (ex), () => {
 228				done [1] = true;
 229				if (done.All (b => b))
 230					sub.OnCompleted ();
 231			}));
 232			
 233			t3.Subscribe (Observer.Create<T3> (t => {
 234				q3.Enqueue (t);
 235				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0)
 236					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue ()));
 237			}, (ex) => sub.OnError (ex), () => {
 238				done [2] = true;
 239				if (done.All (b => b))
 240					sub.OnCompleted ();
 241			}));
 242			
 243			t4.Subscribe (Observer.Create<T4> (t => {
 244				q4.Enqueue (t);
 245				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0)
 246					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue ()));
 247			}, (ex) => sub.OnError (ex), () => {
 248				done [3] = true;
 249				if (done.All (b => b))
 250					sub.OnCompleted ();
 251			}));
 252			
 253
 254			return sub;
 255		}
 256	}
 257	
 258	internal class Plan<T1, T2, T3, T4, TResult> : Plan<TResult>
 259	{
 260		Pattern<T1, T2, T3, T4> pattern;
 261		Func<T1, T2, T3, T4, TResult> selector;
 262		
 263		public Plan (Pattern<T1, T2, T3, T4> pattern, Func<T1, T2, T3, T4, TResult> selector)
 264		{
 265			this.pattern = pattern;
 266			this.selector = selector;
 267		}
 268		
 269		internal override IObservable<TResult> AsObservable ()
 270		{
 271			return pattern.AsObservable<TResult> (selector);
 272		}
 273	}
 274	
 275	public class Pattern<T1, T2, T3, T4, T5> : Pattern
 276	{
 277		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5)
 278		{
 279			this.t1 = t1;
 280			this.t2 = t2;
 281			this.t3 = t3;
 282			this.t4 = t4;
 283			this.t5 = t5;
 284		}
 285		
 286		IObservable<T1> t1;
 287		IObservable<T2> t2;
 288		IObservable<T3> t3;
 289		IObservable<T4> t4;
 290		IObservable<T5> t5;
 291
 292
 293		
 294		public Pattern<T1, T2, T3, T4, T5, T6> And<T6> (IObservable<T6> other)
 295		{
 296			return new Pattern<T1, T2, T3, T4, T5, T6> (t1, t2, t3, t4, t5, other);
 297		}
 298		
 299
 300		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, TResult> selector)
 301		{
 302			return new Plan<T1, T2, T3, T4, T5, TResult> (this, selector);
 303		}
 304		
 305		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, TResult> selector)
 306		{
 307			var sub = new Subject<TResult> ();
 308			bool [] done = new bool [5];
 309			var q1 = new Queue<T1> ();
 310			var q2 = new Queue<T2> ();
 311			var q3 = new Queue<T3> ();
 312			var q4 = new Queue<T4> ();
 313			var q5 = new Queue<T5> ();
 314
 315			
 316			t1.Subscribe (Observer.Create<T1> (t => {
 317				q1.Enqueue (t);
 318				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0)
 319					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue ()));
 320			}, (ex) => sub.OnError (ex), () => {
 321				done [0] = true;
 322				if (done.All (b => b))
 323					sub.OnCompleted ();
 324			}));
 325			
 326			t2.Subscribe (Observer.Create<T2> (t => {
 327				q2.Enqueue (t);
 328				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0)
 329					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue ()));
 330			}, (ex) => sub.OnError (ex), () => {
 331				done [1] = true;
 332				if (done.All (b => b))
 333					sub.OnCompleted ();
 334			}));
 335			
 336			t3.Subscribe (Observer.Create<T3> (t => {
 337				q3.Enqueue (t);
 338				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0)
 339					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue ()));
 340			}, (ex) => sub.OnError (ex), () => {
 341				done [2] = true;
 342				if (done.All (b => b))
 343					sub.OnCompleted ();
 344			}));
 345			
 346			t4.Subscribe (Observer.Create<T4> (t => {
 347				q4.Enqueue (t);
 348				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0)
 349					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue ()));
 350			}, (ex) => sub.OnError (ex), () => {
 351				done [3] = true;
 352				if (done.All (b => b))
 353					sub.OnCompleted ();
 354			}));
 355			
 356			t5.Subscribe (Observer.Create<T5> (t => {
 357				q5.Enqueue (t);
 358				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0)
 359					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue ()));
 360			}, (ex) => sub.OnError (ex), () => {
 361				done [4] = true;
 362				if (done.All (b => b))
 363					sub.OnCompleted ();
 364			}));
 365			
 366
 367			return sub;
 368		}
 369	}
 370	
 371	internal class Plan<T1, T2, T3, T4, T5, TResult> : Plan<TResult>
 372	{
 373		Pattern<T1, T2, T3, T4, T5> pattern;
 374		Func<T1, T2, T3, T4, T5, TResult> selector;
 375		
 376		public Plan (Pattern<T1, T2, T3, T4, T5> pattern, Func<T1, T2, T3, T4, T5, TResult> selector)
 377		{
 378			this.pattern = pattern;
 379			this.selector = selector;
 380		}
 381		
 382		internal override IObservable<TResult> AsObservable ()
 383		{
 384			return pattern.AsObservable<TResult> (selector);
 385		}
 386	}
 387	
 388	public class Pattern<T1, T2, T3, T4, T5, T6> : Pattern
 389	{
 390		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6)
 391		{
 392			this.t1 = t1;
 393			this.t2 = t2;
 394			this.t3 = t3;
 395			this.t4 = t4;
 396			this.t5 = t5;
 397			this.t6 = t6;
 398		}
 399		
 400		IObservable<T1> t1;
 401		IObservable<T2> t2;
 402		IObservable<T3> t3;
 403		IObservable<T4> t4;
 404		IObservable<T5> t5;
 405		IObservable<T6> t6;
 406
 407
 408		
 409		public Pattern<T1, T2, T3, T4, T5, T6, T7> And<T7> (IObservable<T7> other)
 410		{
 411			return new Pattern<T1, T2, T3, T4, T5, T6, T7> (t1, t2, t3, t4, t5, t6, other);
 412		}
 413		
 414
 415		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, TResult> selector)
 416		{
 417			return new Plan<T1, T2, T3, T4, T5, T6, TResult> (this, selector);
 418		}
 419		
 420		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, TResult> selector)
 421		{
 422			var sub = new Subject<TResult> ();
 423			bool [] done = new bool [6];
 424			var q1 = new Queue<T1> ();
 425			var q2 = new Queue<T2> ();
 426			var q3 = new Queue<T3> ();
 427			var q4 = new Queue<T4> ();
 428			var q5 = new Queue<T5> ();
 429			var q6 = new Queue<T6> ();
 430
 431			
 432			t1.Subscribe (Observer.Create<T1> (t => {
 433				q1.Enqueue (t);
 434				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 435					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 436			}, (ex) => sub.OnError (ex), () => {
 437				done [0] = true;
 438				if (done.All (b => b))
 439					sub.OnCompleted ();
 440			}));
 441			
 442			t2.Subscribe (Observer.Create<T2> (t => {
 443				q2.Enqueue (t);
 444				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 445					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 446			}, (ex) => sub.OnError (ex), () => {
 447				done [1] = true;
 448				if (done.All (b => b))
 449					sub.OnCompleted ();
 450			}));
 451			
 452			t3.Subscribe (Observer.Create<T3> (t => {
 453				q3.Enqueue (t);
 454				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 455					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 456			}, (ex) => sub.OnError (ex), () => {
 457				done [2] = true;
 458				if (done.All (b => b))
 459					sub.OnCompleted ();
 460			}));
 461			
 462			t4.Subscribe (Observer.Create<T4> (t => {
 463				q4.Enqueue (t);
 464				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 465					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 466			}, (ex) => sub.OnError (ex), () => {
 467				done [3] = true;
 468				if (done.All (b => b))
 469					sub.OnCompleted ();
 470			}));
 471			
 472			t5.Subscribe (Observer.Create<T5> (t => {
 473				q5.Enqueue (t);
 474				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 475					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 476			}, (ex) => sub.OnError (ex), () => {
 477				done [4] = true;
 478				if (done.All (b => b))
 479					sub.OnCompleted ();
 480			}));
 481			
 482			t6.Subscribe (Observer.Create<T6> (t => {
 483				q6.Enqueue (t);
 484				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0)
 485					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue ()));
 486			}, (ex) => sub.OnError (ex), () => {
 487				done [5] = true;
 488				if (done.All (b => b))
 489					sub.OnCompleted ();
 490			}));
 491			
 492
 493			return sub;
 494		}
 495	}
 496	
 497	internal class Plan<T1, T2, T3, T4, T5, T6, TResult> : Plan<TResult>
 498	{
 499		Pattern<T1, T2, T3, T4, T5, T6> pattern;
 500		Func<T1, T2, T3, T4, T5, T6, TResult> selector;
 501		
 502		public Plan (Pattern<T1, T2, T3, T4, T5, T6> pattern, Func<T1, T2, T3, T4, T5, T6, TResult> selector)
 503		{
 504			this.pattern = pattern;
 505			this.selector = selector;
 506		}
 507		
 508		internal override IObservable<TResult> AsObservable ()
 509		{
 510			return pattern.AsObservable<TResult> (selector);
 511		}
 512	}
 513	
 514	public class Pattern<T1, T2, T3, T4, T5, T6, T7> : Pattern
 515	{
 516		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7)
 517		{
 518			this.t1 = t1;
 519			this.t2 = t2;
 520			this.t3 = t3;
 521			this.t4 = t4;
 522			this.t5 = t5;
 523			this.t6 = t6;
 524			this.t7 = t7;
 525		}
 526		
 527		IObservable<T1> t1;
 528		IObservable<T2> t2;
 529		IObservable<T3> t3;
 530		IObservable<T4> t4;
 531		IObservable<T5> t5;
 532		IObservable<T6> t6;
 533		IObservable<T7> t7;
 534
 535
 536		
 537		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8> And<T8> (IObservable<T8> other)
 538		{
 539			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8> (t1, t2, t3, t4, t5, t6, t7, other);
 540		}
 541		
 542
 543		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, TResult> selector)
 544		{
 545			return new Plan<T1, T2, T3, T4, T5, T6, T7, TResult> (this, selector);
 546		}
 547		
 548		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, TResult> selector)
 549		{
 550			var sub = new Subject<TResult> ();
 551			bool [] done = new bool [7];
 552			var q1 = new Queue<T1> ();
 553			var q2 = new Queue<T2> ();
 554			var q3 = new Queue<T3> ();
 555			var q4 = new Queue<T4> ();
 556			var q5 = new Queue<T5> ();
 557			var q6 = new Queue<T6> ();
 558			var q7 = new Queue<T7> ();
 559
 560			
 561			t1.Subscribe (Observer.Create<T1> (t => {
 562				q1.Enqueue (t);
 563				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 564					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 565			}, (ex) => sub.OnError (ex), () => {
 566				done [0] = true;
 567				if (done.All (b => b))
 568					sub.OnCompleted ();
 569			}));
 570			
 571			t2.Subscribe (Observer.Create<T2> (t => {
 572				q2.Enqueue (t);
 573				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 574					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 575			}, (ex) => sub.OnError (ex), () => {
 576				done [1] = true;
 577				if (done.All (b => b))
 578					sub.OnCompleted ();
 579			}));
 580			
 581			t3.Subscribe (Observer.Create<T3> (t => {
 582				q3.Enqueue (t);
 583				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 584					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 585			}, (ex) => sub.OnError (ex), () => {
 586				done [2] = true;
 587				if (done.All (b => b))
 588					sub.OnCompleted ();
 589			}));
 590			
 591			t4.Subscribe (Observer.Create<T4> (t => {
 592				q4.Enqueue (t);
 593				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 594					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 595			}, (ex) => sub.OnError (ex), () => {
 596				done [3] = true;
 597				if (done.All (b => b))
 598					sub.OnCompleted ();
 599			}));
 600			
 601			t5.Subscribe (Observer.Create<T5> (t => {
 602				q5.Enqueue (t);
 603				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 604					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 605			}, (ex) => sub.OnError (ex), () => {
 606				done [4] = true;
 607				if (done.All (b => b))
 608					sub.OnCompleted ();
 609			}));
 610			
 611			t6.Subscribe (Observer.Create<T6> (t => {
 612				q6.Enqueue (t);
 613				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 614					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 615			}, (ex) => sub.OnError (ex), () => {
 616				done [5] = true;
 617				if (done.All (b => b))
 618					sub.OnCompleted ();
 619			}));
 620			
 621			t7.Subscribe (Observer.Create<T7> (t => {
 622				q7.Enqueue (t);
 623				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0)
 624					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue ()));
 625			}, (ex) => sub.OnError (ex), () => {
 626				done [6] = true;
 627				if (done.All (b => b))
 628					sub.OnCompleted ();
 629			}));
 630			
 631
 632			return sub;
 633		}
 634	}
 635	
 636	internal class Plan<T1, T2, T3, T4, T5, T6, T7, TResult> : Plan<TResult>
 637	{
 638		Pattern<T1, T2, T3, T4, T5, T6, T7> pattern;
 639		Func<T1, T2, T3, T4, T5, T6, T7, TResult> selector;
 640		
 641		public Plan (Pattern<T1, T2, T3, T4, T5, T6, T7> pattern, Func<T1, T2, T3, T4, T5, T6, T7, TResult> selector)
 642		{
 643			this.pattern = pattern;
 644			this.selector = selector;
 645		}
 646		
 647		internal override IObservable<TResult> AsObservable ()
 648		{
 649			return pattern.AsObservable<TResult> (selector);
 650		}
 651	}
 652	
 653	public class Pattern<T1, T2, T3, T4, T5, T6, T7, T8> : Pattern
 654	{
 655		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7, IObservable<T8> t8)
 656		{
 657			this.t1 = t1;
 658			this.t2 = t2;
 659			this.t3 = t3;
 660			this.t4 = t4;
 661			this.t5 = t5;
 662			this.t6 = t6;
 663			this.t7 = t7;
 664			this.t8 = t8;
 665		}
 666		
 667		IObservable<T1> t1;
 668		IObservable<T2> t2;
 669		IObservable<T3> t3;
 670		IObservable<T4> t4;
 671		IObservable<T5> t5;
 672		IObservable<T6> t6;
 673		IObservable<T7> t7;
 674		IObservable<T8> t8;
 675
 676
 677		
 678		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9> And<T9> (IObservable<T9> other)
 679		{
 680			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9> (t1, t2, t3, t4, t5, t6, t7, t8, other);
 681		}
 682		
 683
 684		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> selector)
 685		{
 686			return new Plan<T1, T2, T3, T4, T5, T6, T7, T8, TResult> (this, selector);
 687		}
 688		
 689		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> selector)
 690		{
 691			var sub = new Subject<TResult> ();
 692			bool [] done = new bool [8];
 693			var q1 = new Queue<T1> ();
 694			var q2 = new Queue<T2> ();
 695			var q3 = new Queue<T3> ();
 696			var q4 = new Queue<T4> ();
 697			var q5 = new Queue<T5> ();
 698			var q6 = new Queue<T6> ();
 699			var q7 = new Queue<T7> ();
 700			var q8 = new Queue<T8> ();
 701
 702			
 703			t1.Subscribe (Observer.Create<T1> (t => {
 704				q1.Enqueue (t);
 705				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 706					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 707			}, (ex) => sub.OnError (ex), () => {
 708				done [0] = true;
 709				if (done.All (b => b))
 710					sub.OnCompleted ();
 711			}));
 712			
 713			t2.Subscribe (Observer.Create<T2> (t => {
 714				q2.Enqueue (t);
 715				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 716					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 717			}, (ex) => sub.OnError (ex), () => {
 718				done [1] = true;
 719				if (done.All (b => b))
 720					sub.OnCompleted ();
 721			}));
 722			
 723			t3.Subscribe (Observer.Create<T3> (t => {
 724				q3.Enqueue (t);
 725				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 726					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 727			}, (ex) => sub.OnError (ex), () => {
 728				done [2] = true;
 729				if (done.All (b => b))
 730					sub.OnCompleted ();
 731			}));
 732			
 733			t4.Subscribe (Observer.Create<T4> (t => {
 734				q4.Enqueue (t);
 735				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 736					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 737			}, (ex) => sub.OnError (ex), () => {
 738				done [3] = true;
 739				if (done.All (b => b))
 740					sub.OnCompleted ();
 741			}));
 742			
 743			t5.Subscribe (Observer.Create<T5> (t => {
 744				q5.Enqueue (t);
 745				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 746					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 747			}, (ex) => sub.OnError (ex), () => {
 748				done [4] = true;
 749				if (done.All (b => b))
 750					sub.OnCompleted ();
 751			}));
 752			
 753			t6.Subscribe (Observer.Create<T6> (t => {
 754				q6.Enqueue (t);
 755				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 756					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 757			}, (ex) => sub.OnError (ex), () => {
 758				done [5] = true;
 759				if (done.All (b => b))
 760					sub.OnCompleted ();
 761			}));
 762			
 763			t7.Subscribe (Observer.Create<T7> (t => {
 764				q7.Enqueue (t);
 765				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 766					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 767			}, (ex) => sub.OnError (ex), () => {
 768				done [6] = true;
 769				if (done.All (b => b))
 770					sub.OnCompleted ();
 771			}));
 772			
 773			t8.Subscribe (Observer.Create<T8> (t => {
 774				q8.Enqueue (t);
 775				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0)
 776					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue ()));
 777			}, (ex) => sub.OnError (ex), () => {
 778				done [7] = true;
 779				if (done.All (b => b))
 780					sub.OnCompleted ();
 781			}));
 782			
 783
 784			return sub;
 785		}
 786	}
 787	
 788	internal class Plan<T1, T2, T3, T4, T5, T6, T7, T8, TResult> : Plan<TResult>
 789	{
 790		Pattern<T1, T2, T3, T4, T5, T6, T7, T8> pattern;
 791		Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> selector;
 792		
 793		public Plan (Pattern<T1, T2, T3, T4, T5, T6, T7, T8> pattern, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> selector)
 794		{
 795			this.pattern = pattern;
 796			this.selector = selector;
 797		}
 798		
 799		internal override IObservable<TResult> AsObservable ()
 800		{
 801			return pattern.AsObservable<TResult> (selector);
 802		}
 803	}
 804	
 805	public class Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9> : Pattern
 806	{
 807		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7, IObservable<T8> t8, IObservable<T9> t9)
 808		{
 809			this.t1 = t1;
 810			this.t2 = t2;
 811			this.t3 = t3;
 812			this.t4 = t4;
 813			this.t5 = t5;
 814			this.t6 = t6;
 815			this.t7 = t7;
 816			this.t8 = t8;
 817			this.t9 = t9;
 818		}
 819		
 820		IObservable<T1> t1;
 821		IObservable<T2> t2;
 822		IObservable<T3> t3;
 823		IObservable<T4> t4;
 824		IObservable<T5> t5;
 825		IObservable<T6> t6;
 826		IObservable<T7> t7;
 827		IObservable<T8> t8;
 828		IObservable<T9> t9;
 829
 830
 831		
 832		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> And<T10> (IObservable<T10> other)
 833		{
 834			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> (t1, t2, t3, t4, t5, t6, t7, t8, t9, other);
 835		}
 836		
 837
 838		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> selector)
 839		{
 840			return new Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> (this, selector);
 841		}
 842		
 843		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> selector)
 844		{
 845			var sub = new Subject<TResult> ();
 846			bool [] done = new bool [9];
 847			var q1 = new Queue<T1> ();
 848			var q2 = new Queue<T2> ();
 849			var q3 = new Queue<T3> ();
 850			var q4 = new Queue<T4> ();
 851			var q5 = new Queue<T5> ();
 852			var q6 = new Queue<T6> ();
 853			var q7 = new Queue<T7> ();
 854			var q8 = new Queue<T8> ();
 855			var q9 = new Queue<T9> ();
 856
 857			
 858			t1.Subscribe (Observer.Create<T1> (t => {
 859				q1.Enqueue (t);
 860				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 861					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 862			}, (ex) => sub.OnError (ex), () => {
 863				done [0] = true;
 864				if (done.All (b => b))
 865					sub.OnCompleted ();
 866			}));
 867			
 868			t2.Subscribe (Observer.Create<T2> (t => {
 869				q2.Enqueue (t);
 870				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 871					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 872			}, (ex) => sub.OnError (ex), () => {
 873				done [1] = true;
 874				if (done.All (b => b))
 875					sub.OnCompleted ();
 876			}));
 877			
 878			t3.Subscribe (Observer.Create<T3> (t => {
 879				q3.Enqueue (t);
 880				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 881					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 882			}, (ex) => sub.OnError (ex), () => {
 883				done [2] = true;
 884				if (done.All (b => b))
 885					sub.OnCompleted ();
 886			}));
 887			
 888			t4.Subscribe (Observer.Create<T4> (t => {
 889				q4.Enqueue (t);
 890				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 891					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 892			}, (ex) => sub.OnError (ex), () => {
 893				done [3] = true;
 894				if (done.All (b => b))
 895					sub.OnCompleted ();
 896			}));
 897			
 898			t5.Subscribe (Observer.Create<T5> (t => {
 899				q5.Enqueue (t);
 900				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 901					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 902			}, (ex) => sub.OnError (ex), () => {
 903				done [4] = true;
 904				if (done.All (b => b))
 905					sub.OnCompleted ();
 906			}));
 907			
 908			t6.Subscribe (Observer.Create<T6> (t => {
 909				q6.Enqueue (t);
 910				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 911					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 912			}, (ex) => sub.OnError (ex), () => {
 913				done [5] = true;
 914				if (done.All (b => b))
 915					sub.OnCompleted ();
 916			}));
 917			
 918			t7.Subscribe (Observer.Create<T7> (t => {
 919				q7.Enqueue (t);
 920				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 921					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 922			}, (ex) => sub.OnError (ex), () => {
 923				done [6] = true;
 924				if (done.All (b => b))
 925					sub.OnCompleted ();
 926			}));
 927			
 928			t8.Subscribe (Observer.Create<T8> (t => {
 929				q8.Enqueue (t);
 930				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 931					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 932			}, (ex) => sub.OnError (ex), () => {
 933				done [7] = true;
 934				if (done.All (b => b))
 935					sub.OnCompleted ();
 936			}));
 937			
 938			t9.Subscribe (Observer.Create<T9> (t => {
 939				q9.Enqueue (t);
 940				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0)
 941					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue ()));
 942			}, (ex) => sub.OnError (ex), () => {
 943				done [8] = true;
 944				if (done.All (b => b))
 945					sub.OnCompleted ();
 946			}));
 947			
 948
 949			return sub;
 950		}
 951	}
 952	
 953	internal class Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> : Plan<TResult>
 954	{
 955		Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9> pattern;
 956		Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> selector;
 957		
 958		public Plan (Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9> pattern, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> selector)
 959		{
 960			this.pattern = pattern;
 961			this.selector = selector;
 962		}
 963		
 964		internal override IObservable<TResult> AsObservable ()
 965		{
 966			return pattern.AsObservable<TResult> (selector);
 967		}
 968	}
 969	
 970	public class Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : Pattern
 971	{
 972		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7, IObservable<T8> t8, IObservable<T9> t9, IObservable<T10> t10)
 973		{
 974			this.t1 = t1;
 975			this.t2 = t2;
 976			this.t3 = t3;
 977			this.t4 = t4;
 978			this.t5 = t5;
 979			this.t6 = t6;
 980			this.t7 = t7;
 981			this.t8 = t8;
 982			this.t9 = t9;
 983			this.t10 = t10;
 984		}
 985		
 986		IObservable<T1> t1;
 987		IObservable<T2> t2;
 988		IObservable<T3> t3;
 989		IObservable<T4> t4;
 990		IObservable<T5> t5;
 991		IObservable<T6> t6;
 992		IObservable<T7> t7;
 993		IObservable<T8> t8;
 994		IObservable<T9> t9;
 995		IObservable<T10> t10;
 996
 997
 998		
 999		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> And<T11> (IObservable<T11> other)
1000		{
1001			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, other);
1002		}
1003		
1004
1005		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> selector)
1006		{
1007			return new Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> (this, selector);
1008		}
1009		
1010		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> selector)
1011		{
1012			var sub = new Subject<TResult> ();
1013			bool [] done = new bool [10];
1014			var q1 = new Queue<T1> ();
1015			var q2 = new Queue<T2> ();
1016			var q3 = new Queue<T3> ();
1017			var q4 = new Queue<T4> ();
1018			var q5 = new Queue<T5> ();
1019			var q6 = new Queue<T6> ();
1020			var q7 = new Queue<T7> ();
1021			var q8 = new Queue<T8> ();
1022			var q9 = new Queue<T9> ();
1023			var q10 = new Queue<T10> ();
1024
1025			
1026			t1.Subscribe (Observer.Create<T1> (t => {
1027				q1.Enqueue (t);
1028				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1029					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1030			}, (ex) => sub.OnError (ex), () => {
1031				done [0] = true;
1032				if (done.All (b => b))
1033					sub.OnCompleted ();
1034			}));
1035			
1036			t2.Subscribe (Observer.Create<T2> (t => {
1037				q2.Enqueue (t);
1038				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1039					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1040			}, (ex) => sub.OnError (ex), () => {
1041				done [1] = true;
1042				if (done.All (b => b))
1043					sub.OnCompleted ();
1044			}));
1045			
1046			t3.Subscribe (Observer.Create<T3> (t => {
1047				q3.Enqueue (t);
1048				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1049					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1050			}, (ex) => sub.OnError (ex), () => {
1051				done [2] = true;
1052				if (done.All (b => b))
1053					sub.OnCompleted ();
1054			}));
1055			
1056			t4.Subscribe (Observer.Create<T4> (t => {
1057				q4.Enqueue (t);
1058				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1059					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1060			}, (ex) => sub.OnError (ex), () => {
1061				done [3] = true;
1062				if (done.All (b => b))
1063					sub.OnCompleted ();
1064			}));
1065			
1066			t5.Subscribe (Observer.Create<T5> (t => {
1067				q5.Enqueue (t);
1068				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1069					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1070			}, (ex) => sub.OnError (ex), () => {
1071				done [4] = true;
1072				if (done.All (b => b))
1073					sub.OnCompleted ();
1074			}));
1075			
1076			t6.Subscribe (Observer.Create<T6> (t => {
1077				q6.Enqueue (t);
1078				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1079					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1080			}, (ex) => sub.OnError (ex), () => {
1081				done [5] = true;
1082				if (done.All (b => b))
1083					sub.OnCompleted ();
1084			}));
1085			
1086			t7.Subscribe (Observer.Create<T7> (t => {
1087				q7.Enqueue (t);
1088				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1089					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1090			}, (ex) => sub.OnError (ex), () => {
1091				done [6] = true;
1092				if (done.All (b => b))
1093					sub.OnCompleted ();
1094			}));
1095			
1096			t8.Subscribe (Observer.Create<T8> (t => {
1097				q8.Enqueue (t);
1098				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1099					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1100			}, (ex) => sub.OnError (ex), () => {
1101				done [7] = true;
1102				if (done.All (b => b))
1103					sub.OnCompleted ();
1104			}));
1105			
1106			t9.Subscribe (Observer.Create<T9> (t => {
1107				q9.Enqueue (t);
1108				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1109					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1110			}, (ex) => sub.OnError (ex), () => {
1111				done [8] = true;
1112				if (done.All (b => b))
1113					sub.OnCompleted ();
1114			}));
1115			
1116			t10.Subscribe (Observer.Create<T10> (t => {
1117				q10.Enqueue (t);
1118				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0)
1119					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue ()));
1120			}, (ex) => sub.OnError (ex), () => {
1121				done [9] = true;
1122				if (done.All (b => b))
1123					sub.OnCompleted ();
1124			}));
1125			
1126
1127			return sub;
1128		}
1129	}
1130	
1131	internal class Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> : Plan<TResult>
1132	{
1133		Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> pattern;
1134		Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> selector;
1135		
1136		public Plan (Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> pattern, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> selector)
1137		{
1138			this.pattern = pattern;
1139			this.selector = selector;
1140		}
1141		
1142		internal override IObservable<TResult> AsObservable ()
1143		{
1144			return pattern.AsObservable<TResult> (selector);
1145		}
1146	}
1147	
1148	public class Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : Pattern
1149	{
1150		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7, IObservable<T8> t8, IObservable<T9> t9, IObservable<T10> t10, IObservable<T11> t11)
1151		{
1152			this.t1 = t1;
1153			this.t2 = t2;
1154			this.t3 = t3;
1155			this.t4 = t4;
1156			this.t5 = t5;
1157			this.t6 = t6;
1158			this.t7 = t7;
1159			this.t8 = t8;
1160			this.t9 = t9;
1161			this.t10 = t10;
1162			this.t11 = t11;
1163		}
1164		
1165		IObservable<T1> t1;
1166		IObservable<T2> t2;
1167		IObservable<T3> t3;
1168		IObservable<T4> t4;
1169		IObservable<T5> t5;
1170		IObservable<T6> t6;
1171		IObservable<T7> t7;
1172		IObservable<T8> t8;
1173		IObservable<T9> t9;
1174		IObservable<T10> t10;
1175		IObservable<T11> t11;
1176
1177
1178		
1179		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> And<T12> (IObservable<T12> other)
1180		{
1181			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, other);
1182		}
1183		
1184
1185		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> selector)
1186		{
1187			return new Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> (this, selector);
1188		}
1189		
1190		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> selector)
1191		{
1192			var sub = new Subject<TResult> ();
1193			bool [] done = new bool [11];
1194			var q1 = new Queue<T1> ();
1195			var q2 = new Queue<T2> ();
1196			var q3 = new Queue<T3> ();
1197			var q4 = new Queue<T4> ();
1198			var q5 = new Queue<T5> ();
1199			var q6 = new Queue<T6> ();
1200			var q7 = new Queue<T7> ();
1201			var q8 = new Queue<T8> ();
1202			var q9 = new Queue<T9> ();
1203			var q10 = new Queue<T10> ();
1204			var q11 = new Queue<T11> ();
1205
1206			
1207			t1.Subscribe (Observer.Create<T1> (t => {
1208				q1.Enqueue (t);
1209				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1210					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1211			}, (ex) => sub.OnError (ex), () => {
1212				done [0] = true;
1213				if (done.All (b => b))
1214					sub.OnCompleted ();
1215			}));
1216			
1217			t2.Subscribe (Observer.Create<T2> (t => {
1218				q2.Enqueue (t);
1219				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1220					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1221			}, (ex) => sub.OnError (ex), () => {
1222				done [1] = true;
1223				if (done.All (b => b))
1224					sub.OnCompleted ();
1225			}));
1226			
1227			t3.Subscribe (Observer.Create<T3> (t => {
1228				q3.Enqueue (t);
1229				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1230					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1231			}, (ex) => sub.OnError (ex), () => {
1232				done [2] = true;
1233				if (done.All (b => b))
1234					sub.OnCompleted ();
1235			}));
1236			
1237			t4.Subscribe (Observer.Create<T4> (t => {
1238				q4.Enqueue (t);
1239				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1240					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1241			}, (ex) => sub.OnError (ex), () => {
1242				done [3] = true;
1243				if (done.All (b => b))
1244					sub.OnCompleted ();
1245			}));
1246			
1247			t5.Subscribe (Observer.Create<T5> (t => {
1248				q5.Enqueue (t);
1249				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1250					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1251			}, (ex) => sub.OnError (ex), () => {
1252				done [4] = true;
1253				if (done.All (b => b))
1254					sub.OnCompleted ();
1255			}));
1256			
1257			t6.Subscribe (Observer.Create<T6> (t => {
1258				q6.Enqueue (t);
1259				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1260					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1261			}, (ex) => sub.OnError (ex), () => {
1262				done [5] = true;
1263				if (done.All (b => b))
1264					sub.OnCompleted ();
1265			}));
1266			
1267			t7.Subscribe (Observer.Create<T7> (t => {
1268				q7.Enqueue (t);
1269				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1270					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1271			}, (ex) => sub.OnError (ex), () => {
1272				done [6] = true;
1273				if (done.All (b => b))
1274					sub.OnCompleted ();
1275			}));
1276			
1277			t8.Subscribe (Observer.Create<T8> (t => {
1278				q8.Enqueue (t);
1279				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1280					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1281			}, (ex) => sub.OnError (ex), () => {
1282				done [7] = true;
1283				if (done.All (b => b))
1284					sub.OnCompleted ();
1285			}));
1286			
1287			t9.Subscribe (Observer.Create<T9> (t => {
1288				q9.Enqueue (t);
1289				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1290					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1291			}, (ex) => sub.OnError (ex), () => {
1292				done [8] = true;
1293				if (done.All (b => b))
1294					sub.OnCompleted ();
1295			}));
1296			
1297			t10.Subscribe (Observer.Create<T10> (t => {
1298				q10.Enqueue (t);
1299				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1300					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1301			}, (ex) => sub.OnError (ex), () => {
1302				done [9] = true;
1303				if (done.All (b => b))
1304					sub.OnCompleted ();
1305			}));
1306			
1307			t11.Subscribe (Observer.Create<T11> (t => {
1308				q11.Enqueue (t);
1309				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0)
1310					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Dequeue (), q6.Dequeue (), q7.Dequeue (), q8.Dequeue (), q9.Dequeue (), q10.Dequeue (), q11.Dequeue ()));
1311			}, (ex) => sub.OnError (ex), () => {
1312				done [10] = true;
1313				if (done.All (b => b))
1314					sub.OnCompleted ();
1315			}));
1316			
1317
1318			return sub;
1319		}
1320	}
1321	
1322	internal class Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> : Plan<TResult>
1323	{
1324		Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> pattern;
1325		Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> selector;
1326		
1327		public Plan (Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> pattern, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> selector)
1328		{
1329			this.pattern = pattern;
1330			this.selector = selector;
1331		}
1332		
1333		internal override IObservable<TResult> AsObservable ()
1334		{
1335			return pattern.AsObservable<TResult> (selector);
1336		}
1337	}
1338	
1339	public class Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : Pattern
1340	{
1341		internal Pattern (IObservable<T1> t1, IObservable<T2> t2, IObservable<T3> t3, IObservable<T4> t4, IObservable<T5> t5, IObservable<T6> t6, IObservable<T7> t7, IObservable<T8> t8, IObservable<T9> t9, IObservable<T10> t10, IObservable<T11> t11, IObservable<T12> t12)
1342		{
1343			this.t1 = t1;
1344			this.t2 = t2;
1345			this.t3 = t3;
1346			this.t4 = t4;
1347			this.t5 = t5;
1348			this.t6 = t6;
1349			this.t7 = t7;
1350			this.t8 = t8;
1351			this.t9 = t9;
1352			this.t10 = t10;
1353			this.t11 = t11;
1354			this.t12 = t12;
1355		}
1356		
1357		IObservable<T1> t1;
1358		IObservable<T2> t2;
1359		IObservable<T3> t3;
1360		IObservable<T4> t4;
1361		IObservable<T5> t5;
1362		IObservable<T6> t6;
1363		IObservable<T7> t7;
1364		IObservable<T8> t8;
1365		IObservable<T9> t9;
1366		IObservable<T10> t10;
1367		IObservable<T11> t11;
1368		IObservable<T12> t12;
1369
1370
1371		
1372		public Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> And<T13> (IObservable<T13> other)
1373		{
1374			return new Pattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, other);
1375		}
1376		
1377
1378		public Plan<TResult> Then<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> selector)
1379		{
1380			return new Plan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> (this, selector);
1381		}
1382		
1383		internal IObservable<TResult> AsObservable<TResult> (Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> selector)
1384		{
1385			var sub = new Subject<TResult> ();
1386			bool [] done = new bool [12];
1387			var q1 = new Queue<T1> ();
1388			var q2 = new Queue<T2> ();
1389			var q3 = new Queue<T3> ();
1390			var q4 = new Queue<T4> ();
1391			var q5 = new Queue<T5> ();
1392			var q6 = new Queue<T6> ();
1393			var q7 = new Queue<T7> ();
1394			var q8 = new Queue<T8> ();
1395			var q9 = new Queue<T9> ();
1396			var q10 = new Queue<T10> ();
1397			var q11 = new Queue<T11> ();
1398			var q12 = new Queue<T12> ();
1399
1400			
1401			t1.Subscribe (Observer.Create<T1> (t => {
1402				q1.Enqueue (t);
1403				if (q1.Count > 0 && q2.Count > 0 && q3.Count > 0 && q4.Count > 0 && q5.Count > 0 && q6.Count > 0 && q7.Count > 0 && q8.Count > 0 && q9.Count > 0 && q10.Count > 0 && q11.Count > 0 && q12.Count > 0)
1404					sub.OnNext (selector (q1.Dequeue (), q2.Dequeue (), q3.Dequeue (), q4.Dequeue (), q5.Deque

Large files files are truncated, but you can click here to view the full file