Поделиться через


InkAnalyzer.Activity - событие

Обновлен: Ноябрь 2007

Occurs during calls to the Analyze or BackgroundAnalyze method.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)

Синтаксис

'Декларация
Public Event Activity As ActivityEventHandler
'Применение
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)
JScript не поддерживает события.

Заметки

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 InkAnalyzer, see Data Proxy with Ink Analysis.

Примеры

This example defines an event handler for the ink analyzer's Activity event. If the analysis operation should be canceled, 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 Microsoft.Ink.InkAnalyzer = _
            DirectCast(sender, Microsoft.Ink.InkAnalyzer)

        ' Abort the analysis and get the region that was being analyzed.
        Dim theAnalysisRegion As Microsoft.Ink.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.
        Microsoft.Ink.InkAnalyzer theInkAnalyzer =
            sender as Microsoft.Ink.InkAnalyzer;

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

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

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkAnalyzer Класс

InkAnalyzer - члены

Microsoft.Ink - пространство имен