ExpandCollapsePattern.ExpandCollapseStateProperty 필드

정의

ExpandCollapseState 속성을 식별합니다.

public: static initonly System::Windows::Automation::AutomationProperty ^ ExpandCollapseStateProperty;
public static readonly System.Windows.Automation.AutomationProperty ExpandCollapseStateProperty;
 staticval mutable ExpandCollapseStateProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ExpandCollapseStateProperty As AutomationProperty 

필드 값

AutomationProperty

예제

다음 예제에서는 루트 요소를 루트의 후손이 이며 속성 조건 집합을 만족 하는 UI 자동화 요소의 컬렉션을 반환 하는 함수에 전달 됩니다.

///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy 
/// the specified condition(s).
/// </summary>
/// <param name="targetApp">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying 
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
    AutomationElement targetApp)
{
    if (targetApp == null)
    {
        throw new ArgumentException("Root element cannot be null.");
    }

    PropertyCondition conditionLeafNode =
        new PropertyCondition(
        ExpandCollapsePattern.ExpandCollapseStateProperty, 
        ExpandCollapseState.LeafNode);

    return targetApp.FindAll(
        TreeScope.Descendants, conditionLeafNode);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy 
''' the specified condition(s).
''' </summary>
''' <param name="targetApp">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying 
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal targetApp As AutomationElement) As AutomationElementCollection
    If targetApp Is Nothing Then
        Throw New ArgumentException("Root element cannot be null.")
    End If

    Dim conditionLeafNode As New PropertyCondition( _
    ExpandCollapsePattern.ExpandCollapseStateProperty, _
    ExpandCollapseState.LeafNode)

    Return targetApp.FindAll(TreeScope.Descendants, conditionLeafNode)

End Function 'FindAutomationElement

설명

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

ExpandCollapseState 는 직계 자식 개체의 표시 유형을 나타내며, 모든 하위 개체의 표시 유형을 나타내지는 않습니다.

기본값은 Expanded입니다.

적용 대상

추가 정보