ImmutableInterlocked.TryUpdate<TKey,TValue> Metodo

Definizione

Imposta la chiave specificata sul valore specificato se la chiave specificata è già impostata su un valore specifico.

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

Parametri di tipo

TKey

Tipo delle chiavi contenute nell'insieme.

TValue

Tipo dei valori contenuti nell'insieme.

Parametri

location
ImmutableDictionary<TKey,TValue>

Dizionario da aggiornare.

key
TKey

Chiave da aggiornare.

newValue
TValue

Nuovo valore da impostare.

comparisonValue
TValue

Valore corrente per key affinché l'aggiornamento abbia esito positivo.

Valori restituiti

true se key e comparisonValue sono presenti nel dizionario e il confronto è stato aggiornato a newValue; in caso contrario, false.

Si applica a