ApiInformation.IsPropertyPresent(String, String) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengembalikan true atau false untuk menunjukkan apakah properti tertentu (dapat ditulis atau baca-saja) ada untuk jenis tertentu.
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
Parameter
- typeName
-
String
Platform::String
winrt::hstring
Nama tipe yang memenuhi syarat namespace.
- propertyName
-
String
Platform::String
winrt::hstring
Nama properti.
Mengembalikan
Boolean
bool
Benar jika properti yang ditentukan ada untuk jenis; jika tidak, salah.
Contoh
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");
}