Поделиться через


Strokes.StrokesRemoved - событие

Обновлен: Ноябрь 2007

Occurs when one or more Stroke objects are deleted from the Strokes collection.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Event StrokesRemoved As StrokesEventHandler
'Применение
Dim instance As Strokes
Dim handler As StrokesEventHandler

AddHandler instance.StrokesRemoved, handler
public event StrokesEventHandler StrokesRemoved
public:
 event StrokesEventHandler^ StrokesRemoved {
    void add (StrokesEventHandler^ value);
    void remove (StrokesEventHandler^ value);
}
/** @event */
public void add_StrokesRemoved (StrokesEventHandler value)
/** @event */
public void remove_StrokesRemoved (StrokesEventHandler value)
JScript не поддерживает события.

Заметки

The event handler receives an argument of type StrokesEventArgs containing data about this event.

When you create a StrokesEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

Примеры

In this example, a StrokesRemoved event handler saves removed Stroke objects into a custom Strokes collection.

' Reminder: To avoid a memory leak, you must explicitly call the Dispose() method 
' on any Strokes collection to which an event handler has been attached before 
' the collection goes out of scope. 
Private Sub Strokes_StrokesRemoved(ByVal sender As Object, ByVal e As StrokesEventArgs)
    Try
        ' get the Ink object associated with the 
        ' Strokes collection that fired this event
        Dim mInk As Ink = DirectCast(sender, Strokes).Ink
        ' get the CustomStrokes collection named "REMOVED"
        Dim removed As Strokes = mInk.CustomStrokes("REMOVED")
        ' add the removed Strokes to the custom collection
        removed.Add(mInk.CreateStrokes(e.StrokeIds))

    Catch Ex As ArgumentException
        ' this exception is raised if the named collection ("REMOVED") does not exist
    End Try
End Sub
// Reminder: To avoid a memory leak, you must explicitly call the Dispose() method 
// on any Strokes collection to which an event handler has been attached before 
// the collection goes out of scope. 
private void Strokes_StrokesRemoved(object sender, StrokesEventArgs e)
{
    try
    {
        // get the Ink object associated with the 
        // Strokes collection that fired this event
        Ink mInk = ((Strokes)sender).Ink;
        // get the CustomStrokes collection named "REMOVED"
        Strokes removed = mInk.CustomStrokes["REMOVED"];
        // add the removed Strokes to the custom collection
        removed.Add(mInk.CreateStrokes(e.StrokeIds));
    }
    catch (ArgumentException)
    {
        // this exception is raised if the named collection ("REMOVED") does not exist
    }
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Strokes Класс

Strokes - члены

Microsoft.Ink - пространство имен

Ink

Strokes.Remove