SelectionItemPattern.Pattern Field
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.
Identifies the SelectionItemPattern control pattern.
public: static initonly System::Windows::Automation::AutomationPattern ^ Pattern;
public static readonly System.Windows.Automation.AutomationPattern Pattern;
staticval mutable Pattern : System.Windows.Automation.AutomationPattern
Public Shared ReadOnly Pattern As AutomationPattern
Field Value
Examples
In the following example, a SelectionItemPattern control pattern is obtained from an AutomationElement.
///--------------------------------------------------------------------
/// <summary>
/// Obtains a SelectionItemPattern control pattern from an
/// automation element.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// A SelectionItemPattern object.
/// </returns>
///--------------------------------------------------------------------
private SelectionItemPattern GetSelectionItemPattern(
AutomationElement targetControl)
{
SelectionItemPattern selectionItemPattern = null;
try
{
selectionItemPattern =
targetControl.GetCurrentPattern(
SelectionItemPattern.Pattern)
as SelectionItemPattern;
}
// Object doesn't support the
// SelectionItemPattern control pattern
catch (InvalidOperationException)
{
return null;
}
return selectionItemPattern;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains a SelectionItemPattern control pattern from an
''' automation element.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' A SelectionItemPattern object.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetSelectionItemPattern( _
ByVal targetControl As AutomationElement) As SelectionItemPattern
Dim selectionItemPattern As SelectionItemPattern = Nothing
Try
selectionItemPattern = DirectCast( _
targetControl.GetCurrentPattern(selectionItemPattern.Pattern), _
SelectionItemPattern)
Catch
' Object doesn't support the SelectionItemPattern control pattern
Return Nothing
End Try
Return selectionItemPattern
End Function 'GetSelectionItemPattern
Remarks
This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in SelectionItemPatternIdentifiers.
The pattern identifier is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기