語言

AutomationElement.GetSupportedProperties 方法

定義

取得元素所支援屬性的識別碼。

public:
 cli::array <System::Windows::Automation::AutomationProperty ^> ^ GetSupportedProperties();
public System.Windows.Automation.AutomationProperty[] GetSupportedProperties();
member this.GetSupportedProperties : unit -> System.Windows.Automation.AutomationProperty[]
Public Function GetSupportedProperties () As AutomationProperty()

傳回

一個支援的屬性識別碼陣列。

範例

以下範例展示了如何檢索由 AutomationElement所支持的屬性。

AutomationProperty[] properties = element.GetSupportedProperties();
foreach (AutomationProperty prop in properties)
{
    Console.WriteLine(prop.ProgrammaticName);
    Console.WriteLine(Automation.PropertyName(prop));
}
Dim properties As AutomationProperty() = element.GetSupportedProperties()
Dim prop As AutomationProperty
For Each prop In properties
    Console.WriteLine(prop.ProgrammaticName)
    Console.WriteLine(Automation.PropertyName(prop))
Next prop

備註

回傳的陣列會識別此元素所支援的所有屬性;然而,它也可能包含重複的項目或包含或為 null 空值的屬性。 在大多數情況下,用它 GetCurrentPropertyValue 來判斷房產目前是否有支持並取得其當前價值。

適用於

另請參閱