Share via


ApiInformation.IsPropertyPresent(String, String) Método

Definição

Retorna true ou false para indicar se uma propriedade especificada (gravável ou somente leitura) está presente para um tipo especificado.

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

Parâmetros

typeName
String

Platform::String

winrt::hstring

O nome qualificado do namespace do tipo.

propertyName
String

Platform::String

winrt::hstring

O nome da propriedade.

Retornos

Boolean

bool

True se a propriedade especificada estiver presente para o tipo; caso contrário, false.

Exemplos

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");
}

Aplica-se a