指示可观测序列的每个元素成零个或多个缓冲区,这些缓冲区基于计时信息生成。
Namespace:System.Reactive.Linq
装配: System.Reactive.dll) 中的 System.Reactive (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function Buffer(Of TSource) ( _
source As IObservable(Of TSource), _
timeSpan As TimeSpan, _
timeShift As TimeSpan _
) As IObservable(Of IList(Of TSource))
'Usage
Dim source As IObservable(Of TSource)
Dim timeSpan As TimeSpan
Dim timeShift As TimeSpan
Dim returnValue As IObservable(Of IList(Of TSource))
returnValue = source.Buffer(timeSpan, _
timeShift)
public static IObservable<IList<TSource>> Buffer<TSource>(
this IObservable<TSource> source,
TimeSpan timeSpan,
TimeSpan timeShift
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IObservable<IList<TSource>^>^ Buffer(
IObservable<TSource>^ source,
TimeSpan timeSpan,
TimeSpan timeShift
)
static member Buffer :
source:IObservable<'TSource> *
timeSpan:TimeSpan *
timeShift:TimeSpan -> IObservable<IList<'TSource>>
JScript does not support generic types and methods.
类型参数
- TSource
类型源。
parameters
- source
类型: System.IObservable<TSource>
要生成缓冲区的源序列。
- timeSpan
类型: System.TimeSpan
每个缓冲区的长度。
- timeShift
类型: System.TimeSpan
创建连续缓冲区之间的间隔。
返回值
类型: System.IObservable<IList<TSource>>
可观测的缓冲区序列。
使用说明
在 Visual Basic 和 C# 中,可以将此方法作为 IObservable<TSource> 类型的任何对象的实例方法调用。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。