InkAnalyzerBase.ActivityBase Event

Occurs during calls to the Analyze or BackgroundAnalyze method.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Event ActivityBase As ActivityBaseEventHandler
'Usage
Dim instance As InkAnalyzerBase 
Dim handler As ActivityBaseEventHandler 

AddHandler instance.ActivityBase, handler
public event ActivityBaseEventHandler ActivityBase
public:
 event ActivityBaseEventHandler^ ActivityBase {
    void add (ActivityBaseEventHandler^ value);
    void remove (ActivityBaseEventHandler^ value);
}
JScript does not support events.

Remarks

This event indicates that the ink analyzer is performing ink analysis. This event does not indicate the progress of the ink analyzer in this task.

Handle this event in the following circumstances.

  • To indicate activity to the user.

  • To process user input during synchronous analysis.

  • To receive 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 of ink analysis. The ink analyzer raises this event before and after accessing an ink recognizer during the handwriting recognition phase.

The number of activity events an ink analyzer generates is affected by the following.

  • The ink recognizer that the ink analyzer 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 InkAnalyzerBase, see Data Proxy with Ink Analysis.

Examples

This example defines an event handler for the ink analyzer's ActivityBase event. If the analysis operation should be canceled, the event handler calls Abort on the InkAnalyzerBase 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> 
Sub theInkAnalyzerBase_Activity(ByVal sender As Object, ByVal e As EventArgs)

    Dim abortAnalysis As Boolean = False 

    ' Check if the analysis operation should be canceled. 

    ' Abort analysis if the flag to do so is set. 
    If abortAnalysis Then 
        ' Get the analyzer that raised the Activity event. 
        Dim theInkAnalyzerBase As System.Windows.Ink.AnalysisCore.InkAnalyzerBase = _
            DirectCast(sender, System.Windows.Ink.AnalysisCore.InkAnalyzerBase)

        ' Abort the analysis and get the region that was being analyzed. 
        Dim theAnalysisRegionBase As System.Windows.Ink.AnalysisCore.AnalysisRegionBase = _
            theInkAnalyzerBase.Abort()

        ' Add the region that was being analyzed to the analyzer's dirty region.
        theInkAnalyzerBase.DirtyRegion.Union(theAnalysisRegionBase)
    End If 

End Sub 'theInkAnalyzerBase_Activity
/// <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 theInkAnalyzerBase_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 analyzer that raised the Activity event.
        System.Windows.Ink.AnalysisCore.InkAnalyzerBase theInkAnalyzerBase =
            sender as System.Windows.Ink.AnalysisCore.InkAnalyzerBase;

        // Abort the analysis and get the region that was being analyzed.
        System.Windows.Ink.AnalysisCore.AnalysisRegionBase theAnalysisRegionBase =
            theInkAnalyzerBase.Abort();

        // Add the region that was being analyzed to the analyzer's dirty region.
        theInkAnalyzerBase.DirtyRegion.Union(theAnalysisRegionBase);
    }
}

Platforms

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.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzerBase Class

InkAnalyzerBase Members

System.Windows.Ink.AnalysisCore Namespace