ApiInformation.IsReadOnlyPropertyPresent(String, String) Метод

Определение

Возвращает значение true или false, чтобы указать, присутствует ли указанное свойство только для чтения для указанного типа.

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

Параметры

typeName
String

Platform::String

winrt::hstring

Полное имя пространства имен типа.

propertyName
String

Platform::String

winrt::hstring

Имя свойства.

Возвращаемое значение

Boolean

bool

Значение true , если указанное свойство присутствует для типа; в противном случае — false.

Примеры

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

Применяется к