ScrollItemPattern.Pattern Pole

Definicja

Identyfikuje wzorzec kontrolki ScrollItemPattern .

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 

Wartość pola

AutomationPattern

Przykłady

W poniższym przykładzie ScrollItemPattern wzorzec kontrolki jest uzyskiwany z elementu AutomationElement.

///--------------------------------------------------------------------
/// <summary>
/// Obtains a ScrollItemPattern control pattern from an 
/// automation element.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// A ScrollItemPattern object.
/// </returns>
///--------------------------------------------------------------------
private ScrollItemPattern GetScrollItemPattern(
    AutomationElement targetControl)
{
    ScrollItemPattern scrollItemPattern = null;

    try
    {
        scrollItemPattern =
            targetControl.GetCurrentPattern(
            ScrollItemPattern.Pattern)
            as ScrollItemPattern;
    }
    // Object doesn't support the ScrollItemPattern control pattern
    catch (InvalidOperationException)
    {
        return null;
    }

    return scrollItemPattern;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains a ScrollItemPattern control pattern from an 
''' automation element.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' A ScrollItemPattern object.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetScrollItemPattern( _
ByVal targetControl As AutomationElement) As ScrollItemPattern
    Dim scrollItemPattern As ScrollItemPattern = Nothing

    Try
        scrollItemPattern = DirectCast( _
        targetControl.GetCurrentPattern( _
        scrollItemPattern.Pattern), ScrollItemPattern)
    Catch
        ' Object doesn't support the ScrollItemPattern control pattern
        Return Nothing
    End Try

    Return scrollItemPattern

End Function 'GetScrollItemPattern

Uwagi

Ten identyfikator jest używany przez aplikacje klienckie automatyzacja interfejsu użytkownika. automatyzacja interfejsu użytkownika dostawcy powinni używać odpowiedniego pola w elemencie ScrollItemPatternIdentifiers.

Identyfikator wzorca jest przekazywany do metod, takich jak GetCurrentPattern pobieranie wzorca kontrolki zainteresowania z określonego AutomationElementelementu .

Dotyczy