StrokesEventHandler - делегат
Обновлен: Ноябрь 2007
Represents the method that handles events for adding and removing Strokes on the Ink object, InkOverlay object, InkPicture control, and Strokes collection.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Delegate Sub StrokesEventHandler ( _
sender As Object, _
e As StrokesEventArgs _
)
'Применение
Dim instance As New StrokesEventHandler(AddressOf HandlerMethod)
public delegate void StrokesEventHandler(
Object sender,
StrokesEventArgs e
)
public delegate void StrokesEventHandler(
Object^ sender,
StrokesEventArgs^ e
)
/** @delegate */
public delegate void StrokesEventHandler(
Object sender,
StrokesEventArgs e
)
JScript не поддерживает делегаты.
Параметры
- sender
Тип: System.Object
The source Ink object or Strokes collection of this event.
- e
Тип: Microsoft.Ink.StrokesEventArgs
The StrokesEventArgs object that contains the event data.
Заметки
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.
The StrokesEventHandler delegate is used to implement the InkAdded, InkDeleted, StrokesAdded, and StrokesRemoved event handlers.
Примеры
In this example, an InkAdded event handler writes information about the added strokes to a list box control.
Private Sub Ink_InkAdded(ByVal sender As Object, ByVal e As StrokesEventArgs)
' since this event fires in all modes, we will check EditingMode
' and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Ink
If InkOverlayEditingMode.Ink = Me.mInkOverlay.EditingMode Then
For Each id As Integer In e.StrokeIds
Me.listBoxStrokeId.Items.Add("Added ID:" + id.ToString())
Next
End If
End Sub
private void Ink_InkAdded(object sender, StrokesEventArgs e)
{
// since this event fires in all modes, we will check EditingMode
// and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Ink
if (InkOverlayEditingMode.Ink == this.mInkOverlay.EditingMode)
{
foreach (int id in e.StrokeIds)
{
this.listBoxStrokeId.Items.Add("Added ID:" + id.ToString());
}
}
}
In this example an InkDeleted event handler writes information about the deleted strokes to a list box control.
Private Sub Ink_InkDeleted(ByVal sender As Object, ByVal e As StrokesEventArgs)
' since this event fires in select mode also, we will check EditingMode
' and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete
If InkOverlayEditingMode.Delete = Me.mInkOverlay.EditingMode Then
For Each id As Integer In e.StrokeIds
Me.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString())
Next
End If
End Sub
private void Ink_InkDeleted(object sender, StrokesEventArgs e)
{
// since this event fires in select mode also, we will check EditingMode
// and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete
if (InkOverlayEditingMode.Delete == this.mInkOverlay.EditingMode)
{
foreach (int id in e.StrokeIds)
{
this.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString());
}
}
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0