This documentation is archived and is not being maintained.

InkAnalyzer.Activity Event

Occurs to indicate analysis is occurring in the Analyze or BackgroundAnalyze method.

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

public event ActivityEventHandler Activity

This event indicates that the ink analyzer is performing ink analysis. Be aware that this event does not indicate the ink analyzer's progress.

Your objectives for handling the Activity event may include:

  • Indicating activity to the user.

  • Processing user input during synchronous analysis.

  • Receiving notification of system requests, such as repainting of the application's window.

The ink analyzer raises this event frequently during the layout analysis phase and the writing and drawing classification phase. The ink analyzer raises the Activity event before and after accessing an InkRecognizer during the handwriting recognition phase.

The number of activity events an InkRecognizer generates is affected by:

  • The InkRecognizer that the InkAnalyzer applies to ink recognition.

  • The number and length of strokes that the ink analyzer is analyzing.

  • The number of strokes that are classified as writing.

For more information about synchronizing your application data with the InkAnalyzer, see Data Proxy with Ink Analysis.

This example defines an event handler for the ink analyzer's Activity event. If the analysis operation is flagged to abort, the event handler calls Abort on the InkAnalyzer that generated the event, and updates the analyzer's DirtyRegion property.

/// <summary> 
/// The ink analyzer's Activity event handler. 
/// </summary> 
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkAnalyzer_Activity(object sender, EventArgs e)
    bool abortAnalysis = false;

    // Check if the analysis operation should be canceled. 

    // Abort analysis if the flag to do so is set. 
    if (abortAnalysis)
        // Get the InkAnalyzer that raised the Activity event.
        InkAnalyzer theInkAnalyzer =
            sender as InkAnalyzer;

        // Abort the analysis and get the region that was being analyzed.
        AnalysisRegion theAnalysisRegion = theInkAnalyzer.Abort();

        // Add the region that was being analyzed to the analyzer's dirty region.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.0