Aracılığıyla paylaş


CollectionsMarshal.GetValueRefOrNullRef<TKey,TValue> Yöntem

Tanım

içinde veya TValueDictionary<TKey,TValue> içinde yoksa başvurusuna dictionarybaş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

Bir değerin türü.

Parametreler

dictionary
Dictionary<TKey,TValue>

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

key
TKey

Arama için kullanılan anahtar.

Döndürülenler

TValue

içinde veya TValueDictionary<TKey,TValue> içinde yoksa bir başvuruya nulldictionarybaşvuru.

Açıklamalar

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

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

Şunlara uygulanır