System.Windows.Automation.AutomationProperty.LookupById C# (CSharp) Method

LookupById() public static method

public static LookupById ( int id ) : AutomationProperty
id int
return AutomationProperty
        public static AutomationProperty LookupById(int id)
        {
            return (AutomationProperty)AutomationIdentifier.LookupById(UiaCoreIds.AutomationIdType.Property, id);
        }

Usage Example

Esempio n. 1
0
        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());
        }
All Usage Examples Of System.Windows.Automation.AutomationProperty::LookupById