InkAnalyzer.InkAnalyzerStateChanging 事件
在 InkAnalyzer 協調分析結果之前發生,如此應用程式就能將資料與 InkAnalyzer 同步處理。
命名空間: Microsoft.Ink
組件: Microsoft.Ink.Analysis (在 Microsoft.Ink.Analysis.dll 中)
語法
'宣告
Public Event InkAnalyzerStateChanging As InkAnalyzerStateChangingEventHandler
'用途
Dim instance As InkAnalyzer
Dim handler As InkAnalyzerStateChangingEventHandler
AddHandler instance.InkAnalyzerStateChanging, handler
public event InkAnalyzerStateChangingEventHandler InkAnalyzerStateChanging
public:
event InkAnalyzerStateChangingEventHandler^ InkAnalyzerStateChanging {
void add (InkAnalyzerStateChangingEventHandler^ value);
void remove (InkAnalyzerStateChangingEventHandler^ value);
}
/** @event */
public void add_InkAnalyzerStateChanging (InkAnalyzerStateChangingEventHandler value)
/** @event */
public void remove_InkAnalyzerStateChanging (InkAnalyzerStateChangingEventHandler value)
JScript 不支援事件。
備註
當您的應用程式維護本身的資料結構時使用這個事件,該資料結構會與 InkAnalyzer 的資料結構同步處理。當 InkAnalyzer 引發這個事件時,您的應用程式應該會填入 InkAnalyzer 物件之 RootNode 的 SubNodes 屬性。在協調階段中,InkAnalyzer 會在剖析時使用這項資訊,並且執行筆墨辨識。
InkAnalyzer 會在引發 ReadyToReconcile 事件之後引發這個事件。只有在執行背景分析時,它才會引發這個事件。
當筆墨分析器引發 InkAnalyzerStateChanging 事件時,請鎖定您的資料結構。在這個分析階段期間變更資料結構,可能會造成筆墨分析和同步處理發生錯誤。您可以在筆墨分析器引發 IntermediateResultsUpdated 或 ResultsUpdated 事件時,解除鎖定資料結構。
如需將應用程式資料與 InkAnalyzer 進行同步處理的詳細資訊,請參閱Data Proxy with Ink Analysis。
範例
這個範例會定義 AttachDataProxyEventHandlers 方法,將資料 Proxy 事件處理常式附加至 InkAnalyzer,也就是 theInkAnalyzer。
Private Sub AttachDataProxyEventHandlers()
' If the document model supports on demand data proxy, then add an
' event handler for the PopulateContextNode event. This event is raised
' when the InkAnalyzer accesses a partially populated ContextNode created
' by the document model.
If Me.theDocumentModel.SupportsOnDemandDataProxy Then
AddHandler Me.theInkAnalyzer.PopulateContextNode, AddressOf Me.PopulateContextNode
End If
' Add the other data proxy related event handlers. These events are raised
' by the InkAnalyzer to communicate ink analysis results to the document model.
AddHandler Me.theInkAnalyzer.ContextNodeCreated, AddressOf Me.AddContextNode
AddHandler Me.theInkAnalyzer.ContextNodeDeleting, AddressOf Me.RemoveContextNode
AddHandler Me.theInkAnalyzer.ContextNodeLinkAdding, AddressOf Me.AddContextNodeLink
AddHandler Me.theInkAnalyzer.ContextNodeLinkDeleting, AddressOf Me.RemoveContextNodeLink
AddHandler Me.theInkAnalyzer.ContextNodeMovingToPosition, AddressOf Me.MoveContextNodeToPosition
AddHandler Me.theInkAnalyzer.ContextNodePropertiesUpdated, AddressOf Me.UpdateContextNodeProperties
AddHandler Me.theInkAnalyzer.ContextNodeReparenting, AddressOf Me.ReparentContextNode
AddHandler Me.theInkAnalyzer.InkAnalyzerStateChanging, AddressOf Me.InkAnalyzer_StateChanging
AddHandler Me.theInkAnalyzer.StrokesReparented, AddressOf Me.ReparentStroke
AddHandler Me.theInkAnalyzer.IntermediateResultsUpdated, AddressOf Me.ResultsAvailable
AddHandler Me.theInkAnalyzer.ResultsUpdated, AddressOf Me.ResultsAvailable
End Sub 'AttachDataProxyEventHandlers
private void AttachDataProxyEventHandlers()
{
// If the document model supports on demand data proxy, then add an
// event handler for the PopulateContextNode event. This event is raised
// when the InkAnalyzer accesses a partially populated ContextNode created
// by the document model.
if (this.theDocumentModel.SupportsOnDemandDataProxy)
{
this.theInkAnalyzer.PopulateContextNode +=
new Microsoft.Ink.PopulateContextNodeEventHandler(
this.PopulateContextNode);
}
// Add the other data proxy related event handlers. These events are raised
// by the InkAnalyzer to communicate ink analysis results to the document model.
this.theInkAnalyzer.ContextNodeCreated +=
new Microsoft.Ink.ContextNodeCreatedEventHandler(
this.AddContextNode);
this.theInkAnalyzer.ContextNodeDeleting +=
new Microsoft.Ink.ContextNodeDeletingEventHandler(
this.RemoveContextNode);
this.theInkAnalyzer.ContextNodeLinkAdding +=
new Microsoft.Ink.ContextNodeLinkAddingEventHandler(
this.AddContextNodeLink);
this.theInkAnalyzer.ContextNodeLinkDeleting +=
new Microsoft.Ink.ContextNodeLinkDeletingEventHandler(
this.RemoveContextNodeLink);
this.theInkAnalyzer.ContextNodeMovingToPosition +=
new Microsoft.Ink.ContextNodeMovingToPositionEventHandler(
this.MoveContextNodeToPosition);
this.theInkAnalyzer.ContextNodePropertiesUpdated +=
new Microsoft.Ink.ContextNodePropertiesUpdatedEventHandler(
this.UpdateContextNodeProperties);
this.theInkAnalyzer.ContextNodeReparenting +=
new Microsoft.Ink.ContextNodeReparentingEventHandler(
this.ReparentContextNode);
this.theInkAnalyzer.InkAnalyzerStateChanging +=
new Microsoft.Ink.InkAnalyzerStateChangingEventHandler(
this.InkAnalyzer_StateChanging);
this.theInkAnalyzer.StrokesReparented +=
new Microsoft.Ink.StrokesReparentedEventHandler(
this.ReparentStrokes);
this.theInkAnalyzer.IntermediateResultsUpdated +=
new Microsoft.Ink.ResultsUpdatedEventHandler(
this.ResultsAvailable);
this.theInkAnalyzer.ResultsUpdated +=
new Microsoft.Ink.ResultsUpdatedEventHandler(
this.ResultsAvailable);
}
下列範例會定義用來處理 InkAnalyzerStateChanging 事件的 InkAnalyzer_StateChanging 方法。事件資訊會傳遞至 theDocumentModel 文件模型物件。
這個範例並未提供文件模型的定義,也未示範處理傳入資訊的方式。
'/ <summary>
'/ Handles the InkAnalyzer.InkAnalyzerStateChanging event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
Private Sub InkAnalyzer_StateChanging( _
ByVal sender As Object, _
ByVal e As System.EventArgs)
Me.theDocumentModel.BeginReconcilePhase()
End Sub 'InkAnalyzer_StateChanging
/// <summary>
/// Handles the InkAnalyzer.InkAnalyzerStateChanging event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
private void InkAnalyzer_StateChanging(object sender, System.EventArgs e)
{
this.theDocumentModel.BeginReconcilePhase();
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
請參閱
參考
InkAnalyzer.IntermediateResultsUpdated