ExpandCollapsePattern.ExpandCollapseStateProperty Campo

Definición

Identifica la propiedad 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 de campo

AutomationProperty

Ejemplos

En el ejemplo siguiente, se pasa un elemento raíz a una función que devuelve una colección de elementos Automatización de la interfaz de usuario que son descendientes de la raíz y satisfacen un conjunto de condiciones de propiedad.

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

Comentarios

Este identificador lo usan las aplicaciones cliente de Automatización de la interfaz de usuario. Automatización de la interfaz de usuario proveedores deben usar el campo equivalente en ExpandCollapsePatternIdentifiers.

ExpandCollapseState hace referencia únicamente a la visibilidad de los objetos secundarios inmediatos, no a la visibilidad de todos los objetos descendientes.

El valor predeterminado es Expanded.

Se aplica a

Consulte también