InkAnalyzer.Activity 事件
呼叫 Analyze 或 BackgroundAnalyze 方法時發生。
命名空間: 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 不支援事件。
備註
這個事件表示筆墨分析器正在執行筆墨分析。這個事件不會指出這項工作中筆墨分析器的進度。
請在下列情況下處理這個事件。
向使用者表示活動。
在同步分析時處理使用者輸入。
接收系統要求的通知,例如重繪應用程式視窗。
筆墨分析器經常在筆墨分析的配置分析階段以及書寫和繪圖分類階段引發這個事件。筆墨分析器會在手寫辨識階段時,於存取筆墨分析器之前和之後引發這個事件。
筆墨分析器產生的活動事件數目會受到下列因素影響。
筆墨分析器套用至筆墨辨識的筆墨辨識器。
筆墨分析器正在分析的筆劃數目及長度。
分類為書寫的筆劃數目。
如需將應用程式資料與 InkAnalyzer 進行同步處理的詳細資訊,請參閱Data Proxy with Ink Analysis。
範例
這個範例會定義筆墨分析器之 Activity 事件的事件處理常式。如果應該取消分析作業,則事件處理常式會在產生該事件的 InkAnalyzer 上呼叫 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 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