InkAnalyzer.Activity Event
Occurs to indicate analysis is occurring from the Analyze or BackgroundAnalyze method.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)
XML Namespace: https://schemas.microsoft.com/winfx/2006/xaml/presentation
Syntax
'Declaration
Public Event Activity As ActivityEventHandler
'Usage
Dim instance As InkAnalyzer
Dim handler As ActivityEventHandler
AddHandler instance.Activity, handler
public event ActivityEventHandler Activity
public:
event ActivityEventHandler^ Activity {
void add (ActivityEventHandler^ value);
void remove (ActivityEventHandler^ value);
}
/** @event */
public void add_Activity (ActivityEventHandler value)
/** @event */
public void remove_Activity (ActivityEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.
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.
You may handle the Activity event to:
Indicate activity to the user.
Process user input during synchronous analysis.
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. 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.
Example
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>
Sub theInkAnalyzer_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 InkAnalyzer that raised the Activity event.
Dim theInkAnalyzer As InkAnalyzer = sender
' Abort the analysis and get the region that was being analyzed.
Dim theAnalysisRegion As AnalysisRegion = theInkAnalyzer.Abort()
' Add the region that was being analyzed to the analyzer's dirty region.
theInkAnalyzer.DirtyRegion.Union(theAnalysisRegion)
End If
End Sub 'theInkAnalyzer_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 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.
theInkAnalyzer.DirtyRegion.Union(theAnalysisRegion);
}
}
Platforms
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.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
InkAnalyzer Class
InkAnalyzer Members
System.Windows.Ink Namespace