ContextNodeCreatedEventHandler (Delegado)
Actualización: noviembre 2007
Representa el método que controlará el evento ContextNodeCreated de InkAnalyzer.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)
Sintaxis
'Declaración
Public Delegate Sub ContextNodeCreatedEventHandler ( _
sender As Object, _
e As ContextNodeCreatedEventArgs _
)
'Uso
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 no admite delegados.
Parámetros
- sender
Tipo: System.Object
Origen del evento.
- e
Tipo: Microsoft.Ink.ContextNodeCreatedEventArgs
Datos del evento.
Comentarios
Cuando se crea un delegado de ContextNodeCreatedEventHandler, se identifica el método que controla 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 un método, AddContextNode, que controla el evento ContextNodeCreated. 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.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);
}
}
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