Equals Method (Object)

Task Parallel System.Threading

Determines whether the current CancellationToken instance is equal to the specified Object.

Namespace:  System.Threading
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Overrides Function Equals ( _
	other As Object _
) As Boolean
C#
public override bool Equals(
	Object other
)

Parameters

other
Type: System..::.Object
The other object to which to compare this instance.

Return Value

True if other is a CancellationToken and if the two instances are equal; otherwise, false. Two tokens are equal if they are associated with the same CancellationTokenSource or if they were both constructed from public CancellationToken constructors and their IsCancellationRequested values are equal.

Exceptions

ExceptionCondition
System..::.ObjectDisposedExceptionAn associated CancellationTokenSource has been disposed.

See Also