共用方式為


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

適用於