System.Windows.Automation.AutomationElement.GetSupportedProperties C# (CSharp) Method

GetSupportedProperties() public method

public GetSupportedProperties ( ) : System.Windows.Automation.AutomationProperty[]
return System.Windows.Automation.AutomationProperty[]
        public AutomationProperty[] GetSupportedProperties()
        {
            Array rawPropertyIds;
            Array rawPropertyNames;
            try
            {
                Automation.Factory.PollForPotentialSupportedProperties(this._obj, out rawPropertyIds, out rawPropertyNames);
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
            int[] propertyIds = (int[])rawPropertyIds;

            // This element may support properties that are not registered for this 
            // client.  Filter them out.
            List<AutomationProperty> properties = new List<AutomationProperty>();
            foreach (int propertyId in propertyIds)
            {
                AutomationProperty property = AutomationProperty.LookupById(propertyId);
                if (property != null)
                {
                    properties.Add(property);
                }
            }
            return properties.ToArray();
        }

Usage Example

Exemplo n.º 1
0
Arquivo: Debug.cs Projeto: ritro/White
 public static void LogProperties(AutomationElement element)
 {
     AutomationProperty[] automationProperties = element.GetSupportedProperties();
     foreach (AutomationProperty automationProperty in automationProperties)
     {
         Logger.Info(automationProperty.ProgrammaticName + ":" + element.GetCurrentPropertyValue(automationProperty));
     }
 }
All Usage Examples Of System.Windows.Automation.AutomationElement::GetSupportedProperties