Condividi tramite


Proprietà InkOverlayStrokesDeletingEventArgs.StrokesToDelete

Aggiornamento: novembre 2007

Ottiene l'insieme Strokes eliminato quando viene generato l'evento StrokesDeleting.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property StrokesToDelete As Strokes
'Utilizzo
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

Valore proprietà

Tipo: Microsoft.Ink.Strokes
Insieme Strokes eliminato quando viene generato l'evento StrokesDeleting.

Esempi

In questo esempio viene illustrato come sottoscrivere l'evento StrokesDeleting per poter ripristinare l'ultimo tratto eliminato.

Quando viene generato l'evento StrokesDeleting, gli oggetti Stroke che stanno per essere eliminati vengono salvati.

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());
}

In risposta a un'azione dell'utente, ad esempio la scelta di un oggetto MenuItem, gli oggetti Stroke precedentemente eliminati vengono nuovamente aggiunti all'oggetto Ink originale.

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();
}

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

InkOverlayStrokesDeletingEventArgs Classe

Membri InkOverlayStrokesDeletingEventArgs

Spazio dei nomi Microsoft.Ink

InkOverlay

InkOverlay.StrokesDeleting

AddStrokesAtRectangle