ImmutableInterlocked.TryUpdate<TKey,TValue> Methode

Definition

Legt den angegebenen Schlüssel auf den angegebenen Wert fest, wenn der angegebene Schlüssel bereits auf einen bestimmten Wert festgelegt ist.

public:
generic <typename TKey, typename TValue>
 static bool TryUpdate(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % location, TKey key, TValue newValue, TValue comparisonValue);
public static bool TryUpdate<TKey,TValue>(ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> location, TKey key, TValue newValue, TValue comparisonValue);
static member TryUpdate : ImmutableDictionary * 'Key * 'Value * 'Value -> bool
Public Shared Function TryUpdate(Of TKey, TValue) (ByRef location As ImmutableDictionary(Of TKey, TValue), key As TKey, newValue As TValue, comparisonValue As TValue) As Boolean

Typparameter

TKey

Der Typ der schlüssel, die in der Auflistung enthalten sind.

TValue

Der Typ der Werte, die in der Auflistung enthalten sind.

Parameter

location
ImmutableDictionary<TKey,TValue>

Das wörterbuch, das aktualisiert werden soll.

key
TKey

Der zu aktualisierende Schlüssel.

newValue
TValue

Der neue festzulegende Wert.

comparisonValue
TValue

Der aktuelle Wert für key die erfolgreiche Aktualisierung.

Gibt zurück

true if key and comparisonValue are present in the dictionary and comparison was updated to newValue; otherwise, false.

Gilt für: