共用方式為


Qbservable.Take < TSource > 方法

從可查詢可觀察序列的開頭傳回指定的連續值數目。

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

Syntax

'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
    來源的類型。

參數

傳回值

類型:System.Reactive.Linq.IQbservable< TSource>
可查詢的可觀察序列,其中包含輸入序列開頭的指定專案數目。

使用注意事項

在 Visual Basic 和 C# 中,您可以在IQbservable< TSource > 類型的任何物件上呼叫此方法作為實例方法。 使用執行個體方法語法呼叫這個方法時,請省略第一個參數。 如需詳細資訊,請參閱

另請參閱

參考

Qbservable 類別

System.Reactive.Linq 命名空間