Aracılığıyla paylaş


CollectionsMarshal.GetValueRefOrNullRef<TKey,TValue> Yöntem

Tanım

içinde bir TValue Dictionary<TKey,TValue> başvurusu veya içinde yoksa dictionarybir başvuru null alır.

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

Tür Parametreleri

TKey

Anahtarın türü.

TValue

Değerin türü.

Parametreler

dictionary
Dictionary<TKey,TValue>

Başvuruyu almak için TValue sözlük.

key
TKey

Arama için kullanılan anahtar.

Döndürülenler

TValue

içinde veya TValue Dictionary<TKey,TValue> içinde yoksa dictionarybir başvuruya başvurunull.

Açıklamalar

Başvuru kullanımdayken öğeleri eklememeli veya öğesinden Dictionary<TKey,TValue> TValue kaldırılmamalıdır.

Başvuru null çağrılarak System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T)algılanabilir.

Şunlara uygulanır