ExpandCollapsePattern.ExpandCollapseStateProperty Campo

Definição

Identifica a propriedade 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 

Valor do campo

AutomationProperty

Exemplos

No exemplo a seguir, um elemento raiz é passado para uma função que retorna uma coleção de elementos Automação da Interface do Usuário que são descendentes da raiz e atendem a um conjunto de condições de propriedade.

///--------------------------------------------------------------------
/// <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

Comentários

Esse identificador é usado por aplicativos cliente Automação da Interface do Usuário. Automação da Interface do Usuário provedores devem usar o campo equivalente em ExpandCollapsePatternIdentifiers.

ExpandCollapseState refere-se apenas à visibilidade de objetos filho imediatos; não se refere à visibilidade de todos os objetos descendentes.

O valor padrão é Expanded.

Aplica-se a

Confira também