Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
InvalidatedEvent Field

SelectionPattern.InvalidatedEvent Field

Identifies the event that is raised when a selection in a container has changed significantly and requires sending more addition and removal events than the InvalidateLimit constant permits.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)

public static readonly AutomationEvent InvalidatedEvent
public static final AutomationEvent InvalidatedEvent
public static final var InvalidatedEvent : AutomationEvent
Not applicable.

An invalidated event is raised when a selection in a container has changed significantly and requires sending more addition and removal events than the InvalidateLimit constant permits.

This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in SelectionPatternIdentifiers.

In the following example, an event listener is declared for the 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
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft