Freigeben über


InkOverlayStrokesDeletingEventArgs.StrokesToDelete-Eigenschaft

Ruft die Strokes-Auflistung ab, die gelöscht werden soll, wenn das StrokesDeleting-Ereignis ausgelöst wird.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public ReadOnly Property StrokesToDelete As Strokes
'Usage
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

Eigenschaftenwert

Typ: Microsoft.Ink.Strokes
Die Strokes-Auflistung, die gelöscht werden soll, wenn das StrokesDeleting-Ereignis ausgelöst wird.

Beispiele

In diesem Beispiel wird veranschaulicht, wie Sie das StrokesDeleting-Ereignis abonnieren können, um den zuletzt gelöschten Strich wiederherstellen zu können.

Wenn das StrokesDeleting-Ereignis ausgelöst wird, werden die Stroke-Objekte, die gerade gelöscht werden sollten, gespeichert.

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

Als Reaktion auf eine Benutzeraktion (z. B. Klicken auf ein MenuItem) werden die zuvor gelöschten Stroke-Objekte wieder dem ursprünglichen Ink-Objekt hinzugefügt.

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

Plattformen

Windows Vista

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

Versionsinformationen

.NET Framework

Unterstützt in: 3.0

Siehe auch

Referenz

InkOverlayStrokesDeletingEventArgs-Klasse

InkOverlayStrokesDeletingEventArgs-Member

Microsoft.Ink-Namespace

InkOverlay

InkOverlay.StrokesDeleting

AddStrokesAtRectangle