指示可查询可观测序列的每个元素进入连续的非重叠缓冲区。
Namespace:System.Reactive.Linq
装配: System.Reactive.Providers.dll) 中的 System.Reactive.Providers (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function Buffer(Of TSource, TBufferClosing) ( _
source As IQbservable(Of TSource), _
bufferClosingSelector As Expression(Of Func(Of IObservable(Of TBufferClosing))) _
) As IQbservable(Of IList(Of TSource))
'Usage
Dim source As IQbservable(Of TSource)
Dim bufferClosingSelector As Expression(Of Func(Of IObservable(Of TBufferClosing)))
Dim returnValue As IQbservable(Of IList(Of TSource))
returnValue = source.Buffer(bufferClosingSelector)
public static IQbservable<IList<TSource>> Buffer<TSource, TBufferClosing>(
this IQbservable<TSource> source,
Expression<Func<IObservable<TBufferClosing>>> bufferClosingSelector
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TBufferClosing>
static IQbservable<IList<TSource>^>^ Buffer(
IQbservable<TSource>^ source,
Expression<Func<IObservable<TBufferClosing>^>^>^ bufferClosingSelector
)
static member Buffer :
source:IQbservable<'TSource> *
bufferClosingSelector:Expression<Func<IObservable<'TBufferClosing>>> -> IQbservable<IList<'TSource>>
JScript does not support generic types and methods.
类型参数
- TSource
源的类型。
- TBufferClosing
可查询可观测序列的类型,其元素表示每个生成的缓冲区的关闭。
parameters
- source
类型: System.Reactive.Linq.IQbservable<TSource>
要生成缓冲区的源序列。
- bufferClosingSelector
类型: System.Linq.Expressions.Expression<Func<IObservable<TBufferClosing>>>
调用的函数,用于定义生成的缓冲区的边界。 当上一个缓冲区关闭时,将启动一个新缓冲区。
返回值
类型: System.Reactive.Linq.IQbservable<IList<TSource>>
可查询的可观察缓冲区序列。
使用说明
在 Visual Basic 和 C# 中,可以将此方法作为 IQbservable<TSource> 类型的任何对象的实例方法调用。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。