Share via


ContextNodeDeletingEventHandler Delegate

Represents the method that will handle the ContextNodeDeleting event of an InkAnalyzer.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Delegate Sub ContextNodeDeletingEventHandler ( _
    sender As Object, _
    e As ContextNodeDeletingEventArgs _
)
'Usage
Dim instance As New ContextNodeDeletingEventHandler(AddressOf HandlerMethod)
public delegate void ContextNodeDeletingEventHandler(
    Object sender,
    ContextNodeDeletingEventArgs e
)
public delegate void ContextNodeDeletingEventHandler(
    Object^ sender, 
    ContextNodeDeletingEventArgs^ e
)
JScript does not support delegates.

Parameters

Remarks

When you create a ContextNodeDeletingEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see Events and Delegates.

Examples

The following example defines the method, RemoveContextNode, that handles the ContextNodeDeleting event. The event information is passed to the document model object, theDocumentModel.

This example does not provide the definition of the document model or demonstrate how it processes the information passed to it.

'/ <summary> 
'/ Handles the InkAnalyzer.ContextNodeDeleting event. 
'/ </summary> 
'/ <param name="sender">The source of the event.</param> 
'/ <param name="e">The event data.</param> 
Private Sub RemoveContextNode( _
    ByVal sender As Object, _
    ByVal e As Microsoft.Ink.ContextNodeDeletingEventArgs)

    ' Do not remove unclassified ink nodes from the document model. 
    If Microsoft.Ink.ContextNodeType.UnclassifiedInk _
        <> e.NodeToBeDeleted.Type Then 

        Me.theDocumentModel.RemoveNode(e.NodeToBeDeleted)
    End If 

End Sub 'RemoveContextNode
        /// <summary> 
        /// Handles the InkAnalyzer.ContextNodeDeleting event. 
        /// </summary> 
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The event data.</param>
        private void RemoveContextNode(
            object sender, Microsoft.Ink.ContextNodeDeletingEventArgs e)
        {
            // Do not remove unclassified ink nodes from the document model. 
            if (Microsoft.Ink.ContextNodeType.UnclassifiedInk
                != e.NodeToBeDeleted.Type)
            {
                this.theDocumentModel.RemoveNode(e.NodeToBeDeleted);
            }
        }

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Microsoft.Ink Namespace