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 です。

適用対象

こちらもご覧ください