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