CollectionsMarshal.GetValueRefOrNullRef Método

Definição

Sobrecargas

Name Description
GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)

Obtém ou um ref para a TValue no Dictionary<TKey,TValue> ou um ref null se este não existir no dictionary.

GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey)

Obtém uma referência a um TValue no Dictionary<TKey,TValue> ou uma referência null se esta não existir no dictionary.

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

dictionary
Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

O dicionário para obter a referência TValue .

key
TAlternateKey

A chave usada para a pesquisa.

Devoluções

TValue

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

TValue

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).

Aplica-se a