語言

AsyncEnumerable.TakeWhile 方法

定義

多載

名稱 Description
TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的條件為 true,就會從序列傳回專案。

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的條件為 true,就會從序列傳回專案。 元素的索引用於述詞函式的邏輯中。

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Int32,CancellationToken,ValueTask<Boolean>>)

只要指定的條件為 true,就會從序列傳回專案。 元素的索引用於述詞函式的邏輯中。

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<Boolean>>)

只要指定的條件為 true,就會從序列傳回專案。

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Boolean>)

來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs

只要指定的條件為 true,就會從序列傳回專案。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, bool> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,bool> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, bool> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, Boolean)) As IAsyncEnumerable(Of TSource)

類型參數

TSource

來源元素的類型。

參數

source
IAsyncEnumerable<TSource>

一個用來回傳元素的序列。

predicate
Func<TSource,Boolean>

一個用來測試每個元素條件的函數。

傳回

IAsyncEnumerable<TSource>

包含 IAsyncEnumerable<T> 輸入序列中出現在測試不再通過該元素之前的元素。

例外狀況

predicate 是 null。

適用於

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Int32,Boolean>)

來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs

只要指定的條件為 true,就會從序列傳回專案。 元素的索引用於述詞函式的邏輯中。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, int, bool> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,int,bool> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, int, bool> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, Integer, Boolean)) As IAsyncEnumerable(Of TSource)

類型參數

TSource

來源元素的類型。

參數

source
IAsyncEnumerable<TSource>

一個用來回傳元素的序列。

predicate
Func<TSource,Int32,Boolean>

一個用來測試每個元素條件的函數。

傳回

IAsyncEnumerable<TSource>

包含 IAsyncEnumerable<T> 輸入序列中出現在測試不再通過該元素之前的元素。

例外狀況

predicate 是 null。

適用於

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,Int32,CancellationToken,ValueTask<Boolean>>)

來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs

只要指定的條件為 true,就會從序列傳回專案。 元素的索引用於述詞函式的邏輯中。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, int, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<bool>> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,int,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<bool>> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, int, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<bool>> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, Integer, CancellationToken, ValueTask(Of Boolean))) As IAsyncEnumerable(Of TSource)

類型參數

TSource

來源元素的類型。

參數

source
IAsyncEnumerable<TSource>

一個用來回傳元素的序列。

predicate
Func<TSource,Int32,CancellationToken,ValueTask<Boolean>>

一個用來測試每個元素條件的函數。

傳回

IAsyncEnumerable<TSource>

包含 IAsyncEnumerable<T> 輸入序列中出現在測試不再通過該元素之前的元素。

例外狀況

predicate 是 null。

適用於

TakeWhile<TSource>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<Boolean>>)

來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs
來源:
TakeWhile.cs

只要指定的條件為 true,就會從序列傳回專案。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ TakeWhile(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, Func<TSource, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<bool>> ^ predicate);
public static System.Collections.Generic.IAsyncEnumerable<TSource> TakeWhile<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<bool>> predicate);
static member TakeWhile : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<bool>> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function TakeWhile(Of TSource) (source As IAsyncEnumerable(Of TSource), predicate As Func(Of TSource, CancellationToken, ValueTask(Of Boolean))) As IAsyncEnumerable(Of TSource)

類型參數

TSource

來源元素的類型。

參數

source
IAsyncEnumerable<TSource>

一個用來回傳元素的序列。

predicate
Func<TSource,CancellationToken,ValueTask<Boolean>>

一個用來測試每個元素條件的函數。

傳回

IAsyncEnumerable<TSource>

包含 IAsyncEnumerable<T> 輸入序列中出現在測試不再通過該元素之前的元素。

例外狀況

predicate 是 null。

適用於