InkAnalyzer.ContextNodeMovingToPosition 事件
在 InkAnalyzer 将 ContextNode 移动到 ContextNode.SubNodes 集合中的新位置之前发生。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.dll 中)
语法
声明
Public Event ContextNodeMovingToPosition As ContextNodeMovingToPositionEventHandler
用法
Dim instance As InkAnalyzer
Dim handler As ContextNodeMovingToPositionEventHandler
AddHandler instance.ContextNodeMovingToPosition, handler
public event ContextNodeMovingToPositionEventHandler ContextNodeMovingToPosition
public:
event ContextNodeMovingToPositionEventHandler^ ContextNodeMovingToPosition {
void add (ContextNodeMovingToPositionEventHandler^ value);
void remove (ContextNodeMovingToPositionEventHandler^ value);
}
/** @event */
public void add_ContextNodeMovingToPosition (ContextNodeMovingToPositionEventHandler value)
/** @event */
public void remove_ContextNodeMovingToPosition (ContextNodeMovingToPositionEventHandler value)
JScript 不支持事件。
备注
如果您的应用程序维护其自己的数据结构(该数据结构与 InkAnalyzer 的数据结构同步),请使用此事件。在墨迹分析的协调阶段中,或是在响应在其父级的 SubNodes 集合中移动 ContextNode 的 InkAnalyzer 方法时,将发生此事件。
有关将应用程序数据与 InkAnalyzer 同步的更多信息,请参见Data Proxy with Ink Analysis。
示例
此示例定义 AttachDataProxyEventHandlers 方法,该方法将数据代理事件处理程序附加到一个 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);
}
下面的示例定义 MoveContextNodeToPosition 方法,用以处理 ContextNodeMovingToPosition 事件。事件信息将传递给文档模型对象 theDocumentModel。
此示例不提供文档模型的定义,也不演示文档模型如何处理传入的信息。
'/ <summary>
'/ Handles the InkAnalyzer.ContextNodeMovingToPosition event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
Private Sub MoveContextNodeToPosition( _
ByVal sender As Object, _
ByVal e As Microsoft.Ink.ContextNodeMovingToPositionEventArgs)
Me.theDocumentModel.MoveNode(e.SubNodeToMove, e.NewIndex)
End Sub 'MoveContextNodeToPosition
/// <summary>
/// Handles the InkAnalyzer.ContextNodeMovingToPosition event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
private void MoveContextNodeToPosition(
object sender, Microsoft.Ink.ContextNodeMovingToPositionEventArgs e)
{
this.theDocumentModel.MoveNode(e.SubNodeToMove, e.NewIndex);
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0