ContextNodeCreatedEventHandler 委托
表示将处理 InkAnalyzer 的 ContextNodeCreated 事件的方法。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.dll 中)
语法
声明
Public Delegate Sub ContextNodeCreatedEventHandler ( _
sender As Object, _
e As ContextNodeCreatedEventArgs _
)
用法
Dim instance As New ContextNodeCreatedEventHandler(AddressOf HandlerMethod)
public delegate void ContextNodeCreatedEventHandler(
Object sender,
ContextNodeCreatedEventArgs e
)
public delegate void ContextNodeCreatedEventHandler(
Object^ sender,
ContextNodeCreatedEventArgs^ e
)
/** @delegate */
public delegate void ContextNodeCreatedEventHandler(
Object sender,
ContextNodeCreatedEventArgs e
)
JScript 不支持委托。
参数
- sender
类型:System.Object
事件源。
- e
类型:Microsoft.Ink.ContextNodeCreatedEventArgs
事件数据。
备注
创建 ContextNodeCreatedEventHandler 委托时,需要标识处理该事件的方法。若要将该事件与事件处理程序关联,请将该委托的一个实例添加到事件中。除非移除了该委托,否则每当发生该事件时就会调用此事件处理程序。有关事件处理程序委托的更多信息,请参见 Events and Delegates(事件和委托)。
示例
下面的示例定义 AddContextNode 方法,用以处理 ContextNodeCreated 事件。事件信息将传递给文档模型对象 theDocumentModel。
此示例不提供文档模型的定义,也不演示文档模型如何处理传入的信息。
'/ <summary>
'/ Handles the InkAnalyzer.ContextNodeCreated event.
'/ </summary>
'/ <param name="sender">The source of the event.</param>
'/ <param name="e">The event data.</param>
'/ <remarks>
'/ Note: when this event is fired, the ContextNode has not been populated
'/ with extended and other properties. Handle the ContextNodePropertiesUpdated
'/ event to populate the corresponding ContextNode in the document model.
'/ </remarks>
Private Sub AddContextNode( _
ByVal sender As Object, _
ByVal e As Microsoft.Ink.ContextNodeCreatedEventArgs)
' Do not add unclassified ink nodes to the document model.
If Microsoft.Ink.ContextNodeType.UnclassifiedInk _
<> e.NodeCreated.Type Then
Me.theDocumentModel.AddNode(e.NodeCreated)
End If
End Sub 'AddContextNode
/// <summary>
/// Handles the InkAnalyzer.ContextNodeCreated event.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
/// <remarks>
/// Note: when this event is fired, the ContextNode has not been populated
/// with extended and other properties. Handle the ContextNodePropertiesUpdated
/// event to populate the corresponding ContextNode in the document model.
/// </remarks>
private void AddContextNode(
object sender, Microsoft.Ink.ContextNodeCreatedEventArgs e)
{
// Do not add unclassified ink nodes to the document model.
if (Microsoft.Ink.ContextNodeType.UnclassifiedInk
!= e.NodeCreated.Type)
{
this.theDocumentModel.AddNode(e.NodeCreated);
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0