Sdílet prostřednictvím


IPreferences.Get<T>(String, T, String) Metoda

Definice

Získá hodnotu pro daný klíč nebo výchozí zadaný, pokud klíč neexistuje.

public T Get<T>(string key, T defaultValue, string? sharedName = default);
abstract member Get : string * 'T * string -> 'T
Public Function Get(Of T) (key As String, defaultValue As T, Optional sharedName As String = Nothing) As T

Parametry typu

T

Typ objektu uloženého pro tuto předvolbu.

Parametry

key
String

Klíč, pro který se má načíst hodnota.

defaultValue
T

Výchozí hodnota, která se má vrátit, pokud neexistuje žádná existující hodnota pro key .

sharedName
String

Název sdíleného kontejneru.

Návraty

T

Hodnota pro daný klíč nebo hodnota v defaultValue , pokud neexistuje.

Platí pro