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