CancellationToken.Equality(CancellationToken, CancellationToken) 運算子

定義

判斷兩個 CancellationToken 執行個體是否相等。Determines whether two CancellationToken instances are equal.

public:
 static bool operator ==(System::Threading::CancellationToken left, System::Threading::CancellationToken right);
public static bool operator == (System.Threading.CancellationToken left, System.Threading.CancellationToken right);
static member ( = ) : System.Threading.CancellationToken * System.Threading.CancellationToken -> bool
Public Shared Operator == (left As CancellationToken, right As CancellationToken) As Boolean

參數

left
CancellationToken

第一個執行個體。The first instance.

right
CancellationToken

第二個執行個體。The second instance.

傳回

如果執行個體相等,則為 true;否則為 false。如需詳細資訊,請參閱<備註>一節。true if the instances are equal; otherwise, false See the Remarks section for more information.

例外狀況

相關聯的 CancellationTokenSource 已經處置。An associated CancellationTokenSource has been disposed.

備註

如果下列任何一個條件成立,則兩個解除標記相等:Two cancellation tokens are equal if any one of the following conditions is true:

適用於

另請參閱