ApiInformation.IsReadOnlyPropertyPresent(String, String) Methode

Definition

Gibt true oder false zurück, um anzugeben, ob eine angegebene schreibgeschützte Eigenschaft für einen angegebenen Typ vorhanden ist.

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

Parameter

typeName
String

Platform::String

winrt::hstring

Der namespacequalifizierte Name des Typs.

propertyName
String

Platform::String

winrt::hstring

Der Name der Eigenschaft.

Gibt zurück

Boolean

bool

True , wenn die angegebene Eigenschaft für den Typ vorhanden ist; andernfalls false.

Beispiele

if (Windows.Foundation.Metadata.ApiInformation.IsReadOnlyPropertyPresent("Windows.Devices.Sensors.Accelerometer", "ReadingType"))
{
    Debug.WriteLine("Windows.Devices.Sensors.Accelerometer.ReadingType read-only property was found");
}
else
{
    Debug.WriteLine("Windows.Devices.Sensors.Accelerometer.ReadingType read-only property was NOT found");
}

Gilt für: