InkAnalyzerBase.ActivityBase 事件

在调用 AnalyzeBackgroundAnalyze 方法的过程中发生。

命名空间:  System.Windows.Ink.AnalysisCore
程序集:  IACore(在 IACore.dll 中)

语法

声明
Public Event ActivityBase As ActivityBaseEventHandler
用法
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);
}
/** @event */
public void add_ActivityBase (ActivityBaseEventHandler value)
/** @event */
public void remove_ActivityBase (ActivityBaseEventHandler value)
JScript 不支持事件。

备注

此事件指示墨迹分析器正在执行墨迹分析。此事件不指示墨迹分析器在此任务中的进度。

请在以下情况下处理此事件。

  • 向用户指示活动。

  • 在同步分析过程中处理用户输入。

  • 接收系统请求的通知,如重新绘制应用程序的窗口。

在墨迹分析的布局分析阶段以及书写和绘制分类阶段中,墨迹分析器常常引发此事件。在手写识别阶段中,墨迹分析器在访问墨迹识别器之前和之后引发此事件。

墨迹分析器生成的活动事件数受以下因素影响。

  • 墨迹分析器应用于墨迹识别的墨迹识别器。

  • 墨迹分析器正在分析的笔画的数量和长度。

  • 分类为书写的笔画数。

有关将应用程序数据与 InkAnalyzerBase 同步的更多信息,请参见Data Proxy with Ink Analysis

示例

此示例为墨迹分析器的 ActivityBase 事件定义事件处理程序。如果应当取消分析操作,则该事件处理程序对生成该事件的 InkAnalyzerBase 调用 Abort,并更新分析器的 DirtyRegion 属性。

''' <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);
    }
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzerBase 类

InkAnalyzerBase 成员

System.Windows.Ink.AnalysisCore 命名空间