Automation.PatternName(AutomationPattern) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the name of the specified control pattern.
public:
static System::String ^ PatternName(System::Windows::Automation::AutomationPattern ^ pattern);
public static string PatternName (System.Windows.Automation.AutomationPattern pattern);
static member PatternName : System.Windows.Automation.AutomationPattern -> string
Public Shared Function PatternName (pattern As AutomationPattern) As String
Parameters
- pattern
- AutomationPattern
The identifier of the control pattern.
Returns
The friendly name of the control pattern, or a null reference (Nothing
in Visual Basic) if the specified pattern is not found.
Examples
The following example displays the name of each control pattern supported by an AutomationElement.
Note
Calling GetSupportedPatterns requires a great deal of processing, as it queries the AutomationElement for every possible pattern.
// element is an AutomationElement.
AutomationPattern[] patterns = element.GetSupportedPatterns();
foreach (AutomationPattern pattern in patterns)
{
Console.WriteLine("ProgrammaticName: " + pattern.ProgrammaticName);
Console.WriteLine("PatternName: " + Automation.PatternName(pattern));
}
' element is an AutomationElement.
Dim patterns As AutomationPattern() = element.GetSupportedPatterns()
Dim pattern As AutomationPattern
For Each pattern In patterns
Console.WriteLine("ProgrammaticName: " + pattern.ProgrammaticName)
Console.WriteLine("PatternName: " + Automation.PatternName(pattern))
Next pattern
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기