Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Actualización: noviembre 2007
Representa el método que controlará el evento Activity de un objeto InkAnalyzer.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink.Analysis (en Microsoft.Ink.Analysis.dll)
Sintaxis
'Declaración
Public Delegate Sub ActivityEventHandler ( _
sender As Object, _
e As EventArgs _
)
'Uso
Dim instance As New ActivityEventHandler(AddressOf HandlerMethod)
public delegate void ActivityEventHandler(
Object sender,
EventArgs e
)
public delegate void ActivityEventHandler(
Object^ sender,
EventArgs^ e
)
/** @delegate */
public delegate void ActivityEventHandler(
Object sender,
EventArgs e
)
JScript no admite delegados.
Parámetros
- sender
Tipo: System.Object
Objeto InkAnalyzer de origen de este evento.
- e
Tipo: System.EventArgs
Datos del evento.
Comentarios
Cuando se crea un delegado ActivityEventHandler, se identifica el método que controlará el evento. Para asociar el evento 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 este ejemplo se define un controlador para el evento Activity del analizador de entrada manuscrita. Si debe cancelar la operación de análisis, el controlador de eventos llama al método Abort en el objeto InkAnalyzer que generó el evento y actualiza la propiedad DirtyRegion del analizador.
''' <summary>
''' The ink analyzer's Activity event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInkAnalyzer_Activity(ByVal sender As Object, ByVal e As EventArgs)
Dim abortAnalysis As Boolean = False
' Check if the analysis operation should be canceled.
' Abort analysis if the flag to do so is set.
If abortAnalysis Then
' Get the InkAnalyzer that raised the Activity event.
Dim theInkAnalyzer As Microsoft.Ink.InkAnalyzer = _
DirectCast(sender, Microsoft.Ink.InkAnalyzer)
' Abort the analysis and get the region that was being analyzed.
Dim theAnalysisRegion As Microsoft.Ink.AnalysisRegion = _
theInkAnalyzer.Abort()
' Add the region that was being analyzed to the analyzer's dirty region.
theInkAnalyzer.DirtyRegion.Union(theAnalysisRegion)
End If
End Sub 'theInkAnalyzer_Activity
/// <summary>
/// The ink analyzer's Activity event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkAnalyzer_Activity(object sender, EventArgs e)
{
bool abortAnalysis = false;
// Check if the analysis operation should be canceled.
// Abort analysis if the flag to do so is set.
if (abortAnalysis)
{
// Get the InkAnalyzer that raised the Activity event.
Microsoft.Ink.InkAnalyzer theInkAnalyzer =
sender as Microsoft.Ink.InkAnalyzer;
// Abort the analysis and get the region that was being analyzed.
Microsoft.Ink.AnalysisRegion theAnalysisRegion = theInkAnalyzer.Abort();
// Add the region that was being analyzed to the analyzer's dirty region.
theInkAnalyzer.DirtyRegion.Union(theAnalysisRegion);
}
}
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