ApiInformation.IsReadOnlyPropertyPresent(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 baca-saja tertentu ada untuk jenis tertentu.
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
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.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");
}