InkAnalyzer.PopulateContextNode 事件
InkAnalyzer 在部分填入的 ContextNode 區域內執行分析之前發生。
命名空間: Microsoft.Ink
組件: Microsoft.Ink.Analysis (在 Microsoft.Ink.Analysis.dll 中)
語法
'宣告
Public Event PopulateContextNode As PopulateContextNodeEventHandler
'用途
Dim instance As InkAnalyzer
Dim handler As PopulateContextNodeEventHandler
AddHandler instance.PopulateContextNode, handler
public event PopulateContextNodeEventHandler PopulateContextNode
public:
event PopulateContextNodeEventHandler^ PopulateContextNode {
void add (PopulateContextNodeEventHandler^ value);
void remove (PopulateContextNodeEventHandler^ value);
}
/** @event */
public void add_PopulateContextNode (PopulateContextNodeEventHandler value)
/** @event */
public void remove_PopulateContextNode (PopulateContextNodeEventHandler value)
JScript 不支援事件。
備註
當您的應用程式維護本身的資料結構時使用這個事件,該資料結構會與 InkAnalyzer 的資料結構同步處理。當 InkAnalyzer 引發這個事件時,您的應用程式應該會填入 PopulateContextNodeEventArgs.NodeToPopulate。分析階段時,InkAnalyzer 會引發這個事件,取得正在分析筆墨之所在區域的資訊。
如果文件包含 NodeToPopulate 的連結,則您的應用程式應該會建立和加入這些連結。這個程序需要完整填入來源和目的節點 (包括其祖系),這個事件的事件處理常式才會存在。
如需將應用程式資料與 InkAnalyzer 進行同步處理的詳細資訊,請參閱Data Proxy with Ink Analysis。
在背景分析期間,InkAnalyzer 會在引發 InkAnalyzerStateChanging 事件之後引發這個事件。
範例
這個範例會定義 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);
}
下列範例會定義用來處理 PopulateContextNode 事件的 PopulateContextNode 方法。事件資訊會傳遞至 theDocumentModel 文件模型物件。
這個範例並未提供文件模型的定義,也未示範處理傳入資訊的方式。
'/ <summary>
'/ Handles the InkAnalyzer.PopulateContextNode event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
'/ <remarks>
'/ This event handler fully populates a ContextNode from the document model.
'/ The InkAnalyzer calls this event handler when it accesses a partially
'/ populated ContextNode created by the document model.
'/ </remarks>
Private Sub PopulateContextNode( _
ByVal sender As Object, _
ByVal e As Microsoft.Ink.PopulateContextNodeEventArgs)
Me.theDocumentModel.PopulateNode(e.NodeToPopulate, _
CType(sender, Microsoft.Ink.InkAnalyzer))
End Sub 'PopulateContextNode
/// <summary>
/// Handles the InkAnalyzer.PopulateContextNode event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
/// <remarks>
/// This event handler fully populates a ContextNode from the document model.
/// The InkAnalyzer calls this event handler when it accesses a partially
/// populated ContextNode created by the document model.
/// </remarks>
private void PopulateContextNode(
object sender, Microsoft.Ink.PopulateContextNodeEventArgs e)
{
this.theDocumentModel.PopulateNode(
e.NodeToPopulate, (Microsoft.Ink.InkAnalyzer)sender);
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0