public AutomationPattern[] GetSupportedPatterns()
{
Array rawPatternIds;
Array rawPatternNames;
try
{
Automation.Factory.PollForPotentialSupportedPatterns(this._obj, out rawPatternIds, out rawPatternNames);
}
catch (System.Runtime.InteropServices.COMException e)
{
Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
}
int[] patternIds = (int[])rawPatternIds;
// This element may support patterns that are not registered for this
// client. Filter them out.
List<AutomationPattern> patterns = new List<AutomationPattern>();
foreach (int patternId in patternIds)
{
AutomationPattern pattern = AutomationPattern.LookupById(patternId);
if (pattern != null)
{
patterns.Add(pattern);
}
}
return patterns.ToArray();
}