Compartir a través de


InkOverlayStrokesDeletingEventArgs.StrokesToDelete (Propiedad)

Actualización: noviembre 2007

Obtiene la colección Strokes eliminada cuando se desencadena el evento StrokesDeleting.

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

Sintaxis

'Declaración
Public ReadOnly Property StrokesToDelete As Strokes
'Uso
Dim instance As InkOverlayStrokesDeletingEventArgs
Dim value As Strokes

value = instance.StrokesToDelete
public Strokes StrokesToDelete { get; }
public:
property Strokes^ StrokesToDelete {
    Strokes^ get ();
}
/** @property */
public Strokes get_StrokesToDelete()
public function get StrokesToDelete () : Strokes

Valor de propiedad

Tipo: Microsoft.Ink.Strokes
Colección Strokes eliminada cuando se desencadena el evento StrokesDeleting.

Ejemplos

En este ejemplo se muestra cómo puede suscribirse al evento StrokesDeleting para poder restaurar el último trazo eliminado.

Cuando el evento StrokesDeleting se desencadena, se guardan los objetos Stroke que están a punto de ser eliminados.

Private Sub mInkObject_StrokesDeleting(ByVal sender As Object, ByVal e As InkOverlayStrokesDeletingEventArgs)
    ' Store strokes for later undo. They must be stored in
    ' a separate Ink object. 
    mInkDeleted = New Ink()
    mInkDeleted.AddStrokesAtRectangle(e.StrokesToDelete, e.StrokesToDelete.GetBoundingBox())
End Sub
private void mInkObject_StrokesDeleting(object sender, InkOverlayStrokesDeletingEventArgs e)
{
    // Store strokes for later undo. They must be stored in
    // a separate Ink object. 
    mInkDeleted = new Ink();
    mInkDeleted.AddStrokesAtRectangle(e.StrokesToDelete, e.StrokesToDelete.GetBoundingBox());
}

En respuesta a una acción del usuario, como hacer clic en un objeto MenuItem, los objetos Stroke que se eliminaron anteriormente se agregan de nuevo al objeto Ink original.

If Not mInkDeleted Is Nothing Then
    ' Add strokes back.  (You need to use Ink.AddStrokesAtRectangle as opposed
    ' to Strokes.Add because you are dealing with two different Ink objects.)
    mInkObject.Ink.AddStrokesAtRectangle(mInkDeleted.Strokes, mInkDeleted.Strokes.GetBoundingBox())
    mInkDeleted = Nothing
    ' For best performance, you should Invalidate the rectangle created by the 
    ' bounding box (converted from ink space to pixel space).  For simplicity,
    ' we will just refresh the entire control.
    Refresh()
End If
if (mInkDeleted != null)
{
    // Add strokes back.  (You need to use Ink.AddStrokesAtRectangle as opposed
    // to Strokes.Add because you are dealing with two different Ink objects.)
    mInkObject.Ink.AddStrokesAtRectangle(mInkDeleted.Strokes, mInkDeleted.Strokes.GetBoundingBox());
    mInkDeleted = null;
    // For best performance, you should Invalidate the rectangle created by the 
    // bounding box (converted from ink space to pixel space).  For simplicity,
    // we will just refresh the entire control.
    Refresh();
}

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

InkOverlayStrokesDeletingEventArgs (Clase)

InkOverlayStrokesDeletingEventArgs (Miembros)

Microsoft.Ink (Espacio de nombres)

InkOverlay

InkOverlay.StrokesDeleting

AddStrokesAtRectangle