ApiInformation.IsWriteablePropertyPresent(String, String) 方法

定义

返回 true 或 false 以指示指定类型是否存在指定的可写属性。

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

参数

typeName
String

Platform::String

winrt::hstring

类型的命名空间限定名称。

propertyName
String

Platform::String

winrt::hstring

属性的名称。

返回

Boolean

bool

如果类型存在指定的属性,则为 True;否则为 false

示例

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

适用于