将可查询可观测序列的每个元素投影到一个窗口,该窗口在已满或已过给定时间量时完成。
Namespace:System.Reactive.Linq
装配: system.Reactive.Providers 在 System.Reactive.Providers.dll) 中 (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function Window(Of TSource) ( _
source As IQbservable(Of TSource), _
timeSpan As TimeSpan, _
count As Integer _
) As IQbservable(Of IObservable(Of TSource))
'Usage
Dim source As IQbservable(Of TSource)
Dim timeSpan As TimeSpan
Dim count As Integer
Dim returnValue As IQbservable(Of IObservable(Of TSource))
returnValue = source.Window(timeSpan, _
count)
public static IQbservable<IObservable<TSource>> Window<TSource>(
this IQbservable<TSource> source,
TimeSpan timeSpan,
int count
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IQbservable<IObservable<TSource>^>^ Window(
IQbservable<TSource>^ source,
TimeSpan timeSpan,
int count
)
static member Window :
source:IQbservable<'TSource> *
timeSpan:TimeSpan *
count:int -> IQbservable<IObservable<'TSource>>
JScript does not support generic types and methods.
类型参数
- TSource
源的类型。
参数
- source
类型: System.Reactive.Linq.IQbservable<TSource>
要生成窗口的源序列。
- timeSpan
类型: System.TimeSpan
窗口的最大时间长度。
- count
类型: System.Int32
窗口的最大元素计数。
返回值
类型: System.Reactive.Linq.IQbservable<IObservable<TSource>>
一个可查询的可观测窗口序列。
使用说明
在 Visual Basic 和 C# 中,可以在 IQbservable<TSource> 类型的任何对象上调用此方法作为实例方法。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。