CollectionsMarshal.GetValueRefOrNullRef Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Przeciążenia
| Nazwa | Opis |
|---|---|
| GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey) |
Pobiera odwołanie do |
| GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey) |
Pobiera odwołanie do |
GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)
- Źródło:
- CollectionsMarshal.cs
Pobiera odwołanie do TValue w Dictionary<TKey,TValue> lub wartość null ref, jeśli nie istnieje w 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
Parametry typu
- TKey
Typ kluczy w słowniku.
- TValue
Typ wartości w słowniku.
- TAlternateKey
Typ klucza alternatywnego dla odnośników w słowniku.
Parametry
Słownik umożliwiający pobranie odwołania do TValue.
- key
- TAlternateKey
Klucz używany do wyszukiwania.
Zwraca
Odwołanie do TValue w Dictionary<TKey,TValue> lub odwołanie null, jeśli nie istnieje w dictionary.
Uwagi
Elementy nie powinny być dodawane ani usuwane z Dictionary<TKey,TValue> podczas używania TValue ref.
null ref można wykryć, wywołując IsNullRef<T>(T).
Dotyczy
GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey)
- Źródło:
- CollectionsMarshal.cs
- Źródło:
- CollectionsMarshal.cs
- Źródło:
- CollectionsMarshal.cs
- Źródło:
- CollectionsMarshal.cs
Pobiera odwołanie do TValue w Dictionary<TKey,TValue> lub odwołanie null, jeśli nie istnieje w 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
Parametry typu
- TKey
Typ klucza.
- TValue
Typ wartości.
Parametry
- dictionary
- Dictionary<TKey,TValue>
Słownik umożliwiający pobranie odwołania do TValue.
- key
- TKey
Klucz używany do wyszukiwania.
Zwraca
Odwołanie do TValue w Dictionary<TKey,TValue> lub odwołanie null, jeśli nie istnieje w dictionary.
Uwagi
Elementy nie powinny być dodawane ani usuwane z Dictionary<TKey,TValue> podczas używania TValue ref.
null ref można wykryć, wywołując System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T).