CollectionsMarshal.GetValueRefOrNullRef Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Sobrecargas
| Name | Description |
|---|---|
| GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey) |
Obtém ou um ref para a |
| GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey) |
Obtém uma referência a um |
GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
Obtém ou um ref para a TValue no Dictionary<TKey,TValue> ou um ref null se este não existir no dictionary.
public:
generic <typename TKey, typename TValue, typename TAlternateKey>
static TValue % GetValueRefOrNullRef(System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> dictionary, TAlternateKey key);
public static ref TValue GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> dictionary, TAlternateKey key) where TAlternateKey : allows ref struct;
static member GetValueRefOrNullRef : System.Collections.Generic.Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey> * 'AlternateKey -> 'Value
Public Shared Function GetValueRefOrNullRef(Of TKey, TValue, TAlternateKey) (dictionary As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey), key As TAlternateKey) As TValue
Parâmetros de Tipo Genérico
- TKey
O tipo das chaves no dicionário.
- TValue
O tipo dos valores no dicionário.
- TAlternateKey
O tipo de chave alternativa para consultas no dicionário.
Parâmetros
O dicionário para obter a referência TValue .
- key
- TAlternateKey
A chave usada para a pesquisa.
Devoluções
Uma referência a um TValue no Dictionary<TKey,TValue> ou uma referência null se não existir no dictionary..
Observações
Itens não devem ser adicionados ou removidos enquanto Dictionary<TKey,TValue> a referência TValue estiver em uso.
O refer null pode ser detetado chamando IsNullRef<T>(T).
Aplica-se a
GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey)
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
- Origem:
- CollectionsMarshal.cs
Obtém uma referência a um TValue no Dictionary<TKey,TValue> ou uma referência null se esta não existir no dictionary.
public:
generic <typename TKey, typename TValue>
static TValue % GetValueRefOrNullRef(System::Collections::Generic::Dictionary<TKey, TValue> ^ dictionary, TKey key);
public static ref TValue GetValueRefOrNullRef<TKey,TValue>(System.Collections.Generic.Dictionary<TKey,TValue> dictionary, TKey key);
static member GetValueRefOrNullRef : System.Collections.Generic.Dictionary<'Key, 'Value> * 'Key -> 'Value
Public Shared Function GetValueRefOrNullRef(Of TKey, TValue) (dictionary As Dictionary(Of TKey, TValue), key As TKey) As TValue
Parâmetros de Tipo Genérico
- TKey
O tipo de chave.
- TValue
O tipo de valor.
Parâmetros
- dictionary
- Dictionary<TKey,TValue>
O dicionário para obter a referência TValue .
- key
- TKey
A chave usada para a pesquisa.
Devoluções
Uma referência a um TValue no Dictionary<TKey,TValue> ou uma referência null se não existir no dictionary..
Observações
Itens não devem ser adicionados ou removidos enquanto Dictionary<TKey,TValue> a referência TValue estiver em uso.
O refer null pode ser detetado chamando System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T).