Freigeben über


PropertyCollection.Exchange<T>(Object, T) Method

Definition

Replaces the entry associated with key with value, returning the old value (or default(T)). This is done as a thread-safe/atomic operation.

public T Exchange<T> (object key, T value);
member this.Exchange : obj * 'T -> 'T
Public Function Exchange(Of T) (key As Object, value As T) As T

Type Parameters

T

Parameters

key
Object
value
T

Returns

T

The original entry associated with key or default(T) if there was no value associated with the key.

Applies to