Compartir vía


SelectionPattern.InvalidatedEvent Campo

Definición

Identifica el evento que se genera cuando una selección de un contenedor ha cambiado de manera considerable y requiere el envío de más eventos de adición y eliminación de lo que permite la constante InvalidateLimit.

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

Valor de campo

Ejemplos

En el ejemplo siguiente, se declara un agente de escucha de eventos para .InvalidatedEvent

///--------------------------------------------------------------------
/// <summary>
/// Subscribe to the selection events of interest.
/// </summary>
/// <param name="selectionContainer">
/// Automation element that supports SelectionPattern
/// </param>
///--------------------------------------------------------------------
private void SetSelectionEventHandlers
    (AutomationElement selectionContainer)
{            
    AutomationEventHandler selectionInvalidatedHandler =
        new AutomationEventHandler(SelectionInvalidatedHandler);

    Automation.AddAutomationEventHandler(
        SelectionPattern.InvalidatedEvent, 
        selectionContainer, 
        TreeScope.Element, 
        SelectionInvalidatedHandler);
}

///--------------------------------------------------------------------
/// <summary>
/// Selection invalidated event handler.
/// </summary>
/// <param name="src">Object that raised the event.</param>
/// <param name="e">Event arguments.</param>
///--------------------------------------------------------------------
private void SelectionInvalidatedHandler(object src, AutomationEventArgs e)
{
    // TODO: event handling
}
'''--------------------------------------------------------------------
''' <summary>
''' Subscribe to the selection events of interest.
''' </summary>
''' <param name="selectionContainer">
''' Automation element that supports SelectionPattern
''' </param>
'''--------------------------------------------------------------------
Private Sub SetSelectionEventHandlers( _
ByVal selectionContainer As AutomationElement)
    Dim selectionInvalidatedHandler As AutomationEventHandler = _
    New AutomationEventHandler(AddressOf OnSelectionInvalidatedHandler)

    Automation.AddAutomationEventHandler( _
    SelectionPattern.InvalidatedEvent, _
    selectionContainer, TreeScope.Element, selectionInvalidatedHandler)

End Sub

'''--------------------------------------------------------------------
''' <summary>
''' Selection invalidated event handler.
''' </summary>
''' <param name="src">Object that raised the event.</param>
''' <param name="e">Event arguments.</param>
'''--------------------------------------------------------------------
Private Sub OnSelectionInvalidatedHandler( _
ByVal src As Object, ByVal e As AutomationEventArgs)
    ' TODO: event handling
End Sub

Comentarios

Se genera un evento invalidado cuando una selección de un contenedor ha cambiado significativamente y requiere enviar más eventos de suma y eliminación que los InvalidateLimit permisos constantes.

Las aplicaciones cliente de Automatización de la interfaz de usuario usan este identificador. Los proveedores de automatización de la interfaz de usuario deben usar el campo equivalente en SelectionPatternIdentifiers.

Se aplica a