ApiInformation.IsPropertyPresent(String, String) Méthode

Définition

Retourne true ou false pour indiquer si une propriété spécifiée (en écriture ou en lecture seule) est présente pour un type spécifié.

public:
 static bool IsPropertyPresent(Platform::String ^ typeName, Platform::String ^ propertyName);
 static bool IsPropertyPresent(winrt::hstring const& typeName, winrt::hstring const& propertyName);
public static bool IsPropertyPresent(string typeName, string propertyName);
function isPropertyPresent(typeName, propertyName)
Public Shared Function IsPropertyPresent (typeName As String, propertyName As String) As Boolean

Paramètres

typeName
String

Platform::String

winrt::hstring

Nom qualifié d’espace de noms du type.

propertyName
String

Platform::String

winrt::hstring

Nom de la propriété.

Retours

Boolean

bool

True si la propriété spécifiée est présente pour le type ; sinon, false.

Exemples

if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.Devices.Sensors.Accelerometer", "ReadingTransform"))
{
    Debug.WriteLine("Windows.Devices.Sensors.Accelerometer.ReadingTransform property was found");
}
else
{
    Debug.WriteLine("Windows.Devices.Sensors.Accelerometer.ReadingTransform property was NOT found");
}

S’applique à