Share via


ContextNodeDeletingEventHandler (Delegado)

Actualización: noviembre 2007

Representa el método que controlará el evento ContextNodeDeleting de InkAnalyzer.

Espacio de nombres:  Microsoft.Ink
Ensamblado:  Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)

Sintaxis

'Declaración
Public Delegate Sub ContextNodeDeletingEventHandler ( _
    sender As Object, _
    e As ContextNodeDeletingEventArgs _
)
'Uso
Dim instance As New ContextNodeDeletingEventHandler(AddressOf HandlerMethod)
public delegate void ContextNodeDeletingEventHandler(
    Object sender,
    ContextNodeDeletingEventArgs e
)
public delegate void ContextNodeDeletingEventHandler(
    Object^ sender, 
    ContextNodeDeletingEventArgs^ e
)
/** @delegate */
public delegate void ContextNodeDeletingEventHandler(
    Object sender,
    ContextNodeDeletingEventArgs e
)
JScript no admite delegados.

Parámetros

Comentarios

Cuando se crea un delegado de ContextNodeDeletingEventHandler, se identifica el método que controlará el evento. Para asociarlo al controlador de eventos, se debe agregar al evento una instancia del delegado. Siempre que se produce el evento, se llama a su controlador, a menos que se quite el delegado. Para obtener más información sobre los delegados de controladores de eventos, vea Events and Delegates.

Ejemplos

En el ejemplo siguiente se define el método, RemoveContextNode, que controla el evento ContextNodeDeleting. La información del evento se pasa al objeto del modelo de documento, theDocumentModel.

En este ejemplo no se proporciona la definición del modelo de documento ni se muestra cómo procesa la información que se le pasa.

'/ <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);
            }
        }

Plataformas

Windows Vista

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

Microsoft.Ink (Espacio de nombres)