SelectionPattern.InvalidatedEvent Champ
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Identifie l’événement déclenché lorsqu’une sélection dans un conteneur a changé de manière significative et nécessite l’envoi d’événements d’ajout et de suppression plus importants que les InvalidateLimit autorisations constantes.
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
Valeur de champ
Exemples
Dans l’exemple suivant, un écouteur d’événements est déclaré pour le 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
Remarques
Un événement invalidé est déclenché lorsqu’une sélection dans un conteneur a changé de manière significative et nécessite l’envoi de plus d’événements d’ajout et de suppression que les InvalidateLimit autorisations constantes.
Cet identificateur est utilisé par UI Automation applications clientes. UI Automation fournisseurs doivent utiliser le champ équivalent dans SelectionPatternIdentifiers.