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