public AutomationProperty[] GetSupportedProperties()
{
int[] propertyIds;
Automation.AutomationClass.PollForPotentialSupportedProperties(pElement: IUIAutomationElement, propertyIds: out propertyIds, propertyNames: out var _);
var automationPropertyList = new List <AutomationProperty>();
for (var index = 0; index < propertyIds.Length; ++index)
{
if (propertyIds[index] != 0)
{
try {
var automationProperty = AutomationProperty.LookupById(id: propertyIds[index]);
automationPropertyList.Add(item: automationProperty);
} catch (KeyNotFoundException ex) {
}
}
}
return(automationPropertyList.ToArray());
}