Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AutomationElement.GetSupportedPatterns Method

Retrieves the control patterns that this AutomationElement supports.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)

public AutomationPattern[] GetSupportedPatterns ()
public AutomationPattern[] GetSupportedPatterns ()
public function GetSupportedPatterns () : AutomationPattern[]
Not applicable.

Return Value

An array of AutomationPattern objects that represent the supported control patterns.

This method would typically be used for debugging. Calling it requires a great deal of processing, as it queries the AutomationElement for every possible pattern. Normally you would use GetCurrentPattern to retrieve a specific control pattern from an AutomationElement. To ascertain whether a particular pattern is supported, check the appropriate property; for example, IsWindowPatternAvailableProperty.

The following example shows how to retrieve the control patterns supported by an AutomationElement.

// element is an AutomationElement.
AutomationPattern[] patterns = element.GetSupportedPatterns();
foreach (AutomationPattern pattern in patterns)
{
    Console.WriteLine("ProgrammaticName: " + pattern.ProgrammaticName);
    Console.WriteLine("PatternName: " + Automation.PatternName(pattern));
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.