共用方式為


ContextNodeCreatedEventHandler 委派

表示將處理 InkAnalyzerContextNodeCreated 事件的方法。

命名空間:  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 不支援委派。

參數

備註

在建立 ContextNodeCreatedEventHandler 委派 (Delegate) 時,您會識別處理事件的方法。若要使事件與您的事件處理常式產生關聯,請將委派的執行個體 (Instance) 加入至事件。除非您移除委派,否則每當事件發生時就會呼叫事件處理常式。如需事件處理常式委派的詳細資訊,請參閱事件和委派 (英文)。

範例

下列範例會定義用來處理 ContextNodeCreated 事件的 AddContextNode 方法。事件資訊會傳遞至 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

請參閱

參考

Microsoft.Ink 命名空間