Qbservable.Take<TSource> 方法

从可查询可观测序列的开头返回指定数量的连续值。

Namespace:System.Reactive.Linq
装配: System.Reactive.Providers.dll) 中的 System.Reactive.Providers (

语法

'Declaration
<ExtensionAttribute> _
Public Shared Function Take(Of TSource) ( _
    source As IQbservable(Of TSource), _
    count As Integer _
) As IQbservable(Of TSource)
'Usage
Dim source As IQbservable(Of TSource)
Dim count As Integer
Dim returnValue As IQbservable(Of TSource)

returnValue = source.Take(count)
public static IQbservable<TSource> Take<TSource>(
    this IQbservable<TSource> source,
    int count
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IQbservable<TSource>^ Take(
    IQbservable<TSource>^ source, 
    int count
)
static member Take : 
        source:IQbservable<'TSource> * 
        count:int -> IQbservable<'TSource> 
JScript does not support generic types and methods.

类型参数

  • TSource
    源的类型。

parameters

返回值

类型: System.Reactive.Linq.IQbservable<TSource>
一个可查询的可观察序列,其中包含输入序列开头的指定数量的元素。

使用说明

在 Visual Basic 和 C# 中,可以将此方法作为 IQbservable<TSource> 类型的任何对象的实例方法调用。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅

另请参阅

参考

Qbservable 类

System.Reactive.Linq 命名空间