CancellationToken.Equals 方法

定義

判斷目前的 CancellationToken 執行個體與指定的語彙基元是否相等。Determines whether the current CancellationToken instance is equal to the specified token.

多載

Equals(Object)

判斷目前的 CancellationToken 執行個體與指定的 Object 是否相等。Determines whether the current CancellationToken instance is equal to the specified Object.

Equals(CancellationToken)

判斷目前的 CancellationToken 執行個體與指定的語彙基元是否相等。Determines whether the current CancellationToken instance is equal to the specified token.

Equals(Object)

判斷目前的 CancellationToken 執行個體與指定的 Object 是否相等。Determines whether the current CancellationToken instance is equal to the specified Object.

public:
 override bool Equals(System::Object ^ other);
public override bool Equals (object other);
override this.Equals : obj -> bool
Public Overrides Function Equals (other As Object) As Boolean

參數

other
Object

與這個執行個體相互比較的其他物件。The other object to compare with this instance.

傳回

如果 otherCancellationToken,且兩個執行個體相等,則為 true;否則為 falsetrue if other is a CancellationToken and if the two 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:

另請參閱

Equals(CancellationToken)

判斷目前的 CancellationToken 執行個體與指定的語彙基元是否相等。Determines whether the current CancellationToken instance is equal to the specified token.

public:
 bool Equals(System::Threading::CancellationToken other);
public bool Equals (System.Threading.CancellationToken other);
override this.Equals : System.Threading.CancellationToken -> bool
Public Function Equals (other As CancellationToken) As Boolean

參數

other
CancellationToken

與這個執行個體比較的其他 CancellationTokenThe other CancellationToken to compare with this instance.

傳回

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

備註

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

另請參閱

適用於