Freigeben über


SelectionItemPattern.Pattern Feld

Definition

Bezeichnet das SelectionItemPattern-Steuerelementmuster.

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 

Feldwert

AutomationPattern

Beispiele

Im folgenden Beispiel wird ein SelectionItemPattern Steuerelementmuster aus einem 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

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierung Clientanwendungen verwendet. Benutzeroberflächenautomatisierung Anbieter sollten das entsprechende Feld in SelectionItemPatternIdentifiersverwenden.

Der Musterbezeichner wird an Methoden übergeben, zGetCurrentPattern. B. zum Abrufen des Steuerelementmusters von Interesse aus dem angegebenen .AutomationElement

Gilt für