3) GridPattern

GridPattern은 자식 요소를 보관하는 컬렉션의 컨터이너 역할을 하는 컨트롤 패턴입니다.

System.Object
System.Windows.Automation.BasePattern
System.Windows.Automation.GridPattern
System.Windows.Automation.TablePattern

네임스페이스:  System.Windows.Automation
어셈블리:  UIAutomationClient(UIAutomationClient.dll)

GridPattern의 Current 및 Cached 속성으로 GridPatternInformation 구조체를 접근할 수 있습니다. 그리고 GridPatternInformation 구조체에는 열의 수와 행의 수를 가져오기 할 수 있는 멤버 속성으로 ColumnCount와 RowCount를 제공합니다.

그리고 row 인덱스와 column 인덱스를 입력 인자로 전달하면 지정한 셀의 자식 자동화 요소를 반환하는 GetItem 메서드를 제공합니다.

public AutomationElement GetItem(int row, int column)

GridPattern 클래스이 정적 멤버 필드에는 ColumnCount 속성을 식별하는 ColumnCountProperty와 RowCount 속성을 식별하는 RowCountProperty, GridPattern을 식별하는 Pattern을 제공합니다. 다음은 RownCountProperty 정적 멤버 필드를 인자로 Condition 개체를 만드는 예입니다.

PropertyCondition condition = new PropertyCondition(GridPattern.RowCountProperty,1);