ApiInformation.IsWriteablePropertyPresent(String, String) Metode

Definisi

Mengembalikan true atau false untuk menunjukkan apakah properti yang dapat ditulis yang ditentukan ada untuk jenis tertentu.

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

Parameter

typeName
String

Platform::String

winrt::hstring

Nama tipe yang memenuhi syarat namespace.

propertyName
String

Platform::String

winrt::hstring

Nama properti.

Mengembalikan

Boolean

bool

True jika properti yang ditentukan ada untuk jenis; jika tidak, salah.

Contoh

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

Berlaku untuk