Język

AdditionalPropertiesDictionary<TValue>.IDictionary<String,TValue>.TryGetValue Metoda

Definicja

Pobiera wartość skojarzona z określonym kluczem.

 virtual bool System.Collections.Generic.IDictionary<System.String,TValue>.TryGetValue(System::String ^ key, [Runtime::InteropServices::Out] TValue % value) = System::Collections::Generic::IDictionary<System::String ^, TValue>::TryGetValue;
bool IDictionary<string,TValue>.TryGetValue(string key, out TValue value);
abstract member System.Collections.Generic.IDictionary<System.String,TValue>.TryGetValue : string * 'Value -> bool
override this.System.Collections.Generic.IDictionary<System.String,TValue>.TryGetValue : string * 'Value -> bool
Function TryGetValue (key As String, ByRef value As TValue) As Boolean Implements IDictionary(Of String, TValue).TryGetValue

Parametry

key
String

Klucz, którego wartość ma być pobierana.

value
TValue

Gdy ta metoda zwróci wartość skojarzona z określonym kluczem, jeśli zostanie znaleziony klucz; w przeciwnym razie wartość domyślna typu parametru value . Ten parametr jest przekazywany niezainicjowany.

Zwraca

true jeśli obiekt implementujący IDictionary<TKey,TValue> zawiera element z określonym kluczem; w przeciwnym razie false.

Implementuje

Dotyczy