다음을 통해 공유


TablePattern.Pattern 필드

정의

TablePattern 컨트롤 패턴을 식별합니다.

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 

필드 값

AutomationPattern

예제

다음 예제에서는 TablePattern 에서 가져온 컨트롤 패턴을 AutomationElement.

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

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

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

    Try
        tablePattern = DirectCast( _
        targetControl.GetCurrentPattern(tablePattern.Pattern), TablePattern)
    Catch exc As InvalidOperationException
        ' Object doesn't support the 
        ' GridPattern control pattern
        Return Nothing
    End Try

    Return tablePattern

End Function 'GetTablePattern

설명

이 식별자는 UI 자동화 클라이언트 애플리케이션에서 사용 됩니다. UI 자동화 공급자의 해당 필드를 사용 해야 TablePatternIdentifiers합니다.

패턴 식별자를 같은 메서드에 전달 GetCurrentPattern 지정 된 위치에서 원하는 컨트롤 패턴을 검색할 AutomationElement합니다.

적용 대상

추가 정보