AutomationElement.RootElement 속성

정의

현재 데스크톱의 루트 AutomationElement 를 가져옵니다.

public:
 static property System::Windows::Automation::AutomationElement ^ RootElement { System::Windows::Automation::AutomationElement ^ get(); };
public static System.Windows.Automation.AutomationElement RootElement { get; }
static member RootElement : System.Windows.Automation.AutomationElement
Public Shared ReadOnly Property RootElement As AutomationElement

속성 값

루트 요소입니다.

예제

다음 예제 코드는 데스크톱의 모든 직할 자식 컬렉션을 검색합니다.

AutomationElementCollection desktopChildren =
    AutomationElement.RootElement.FindAll(
    TreeScope.Children, Condition.TrueCondition);
Dim desktopChildren As AutomationElementCollection
desktopChildren = AutomationElement.RootElement.FindAll( _
    TreeScope.Children, Condition.TrueCondition)

설명

루트 요소와 FindAll 메서드를 사용하여 FindFirst 다른 요소를 찾기 위한 시작점으로 사용할 수 있습니다.

루트 요소에서 검색할 때는 검색 범위에서 지정하지 않고 지정 Children 해야 합니다 Descendants. 데스크톱의 전체 하위 트리를 검색하면 수천 항목을 반복하여 스택 오버플로가 발생할 수 있습니다.

적용 대상