SelectionPattern.InvalidatedEvent Bidang
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengidentifikasi peristiwa yang dimunculkan ketika pilihan dalam kontainer telah berubah secara signifikan dan mengharuskan pengiriman lebih banyak peristiwa penambahan dan penghapusan daripada InvalidateLimit izin konstanta.
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
Nilai Bidang
Contoh
Dalam contoh berikut, pendengar peristiwa dinyatakan untuk 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
Keterangan
Peristiwa yang tidak valid dinaikkan ketika pilihan dalam kontainer telah berubah secara signifikan dan mengharuskan pengiriman lebih banyak peristiwa penambahan dan penghapusan daripada InvalidateLimit yang diizinkan konstanta.
Pengidentifikasi ini digunakan oleh aplikasi klien Automation UI. Penyedia Automation UI harus menggunakan bidang yang setara di SelectionPatternIdentifiers.