| 1 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. |
| 2 |
|
| 3 |
using System; |
| 4 |
using System.Collections.Generic; |
| 5 |
|
| 6 |
namespace System.Reactive |
| 7 |
{ |
| 8 |
abstract class ConcatSink<TSource> : TailRecursiveSink<TSource> |
| 9 |
{ |
| 10 |
public ConcatSink(IObserver<TSource> observer, IDisposable cancel) |
| 11 |
: base(observer, cancel) |
| 12 |
{ |
| 13 |
} |
| 14 |
|
| 15 |
protected override IEnumerable<IObservable<TSource>> Extract(IObservable<TSource> source) |
| 16 |
{ |
| 17 |
var concat = source as IConcatenatable<TSource>; |
| 18 |
if (concat != null) |
| 19 |
return concat.GetSources(); |
| 20 |
|
| 21 |
return null; |
| 22 |
} |
| 23 |
|
| 24 |
public override void OnCompleted() |
| 25 |
{ |
| 26 |
_recurse(); |
| 27 |
} |
| 28 |
} |
| 29 |
} |