ImmutableInterlocked.TryAdd<TKey,TValue> Método

Definição

Adiciona a chave e o valor especificados ao dicionário se a chave não estiver no dicionário.

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

Parâmetros de Tipo Genérico

TKey

O tipo das chaves contidas na coleção.

TValue

O tipo dos valores contidos na coleção.

Parâmetros

location
ImmutableDictionary<TKey,TValue>

O dicionário para atualizar com a chave e o valor especificados.

key
TKey

A chave a acrescentar, se não estiver já definida no dicionário.

value
TValue

O valor a acrescentar.

Devoluções

true se a chave não estiver no dicionário; caso contrário, false.

Aplica-se a