The event handler receives an argument of type GdViewer.AnnotationAddedByUserEventArgs containing data related to this event. The following GdViewer.AnnotationAddedByUserEventArgs properties provide information specific to this event.
Property | Description |
---|
AnnotationIdx | The 0-based index of the newly added annotation within the current page of the displayed document. It is a value from 0 to GetAnnotationCount-1. |
Handled | (Inherited from System.Windows.RoutedEventArgs) |
OriginalSource | (Inherited from System.Windows.RoutedEventArgs) |
RoutedEvent | (Inherited from System.Windows.RoutedEventArgs) |
Source | (Inherited from System.Windows.RoutedEventArgs) |
How to utilize this event in your GdViewer control. This example shows you how to address the currently added annotation for changing its properties.
'We assume that the GdViewer1 control has been properly integrated
'and the AnnotationAddedByUser event has been properly added.
'Define the event.
Sub GdViewer1_AnnotationAddedByUser(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.AnnotationAddedByUserEventArgs)
Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx)
annot.Author = "GdPicture"
If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote OrElse
TypeOf annot Is GdPicture14.Annotations.AnnotationText Then
GdViewer1.DisplayTextEditBox(e.AnnotationIdx)
End If
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the AnnotationAddedByUser event has been properly added.
//Define the event.
void GdViewer1_AnnotationAddedByUser(object sender, GdPicture14.WPF.GdViewer.AnnotationAddedByUserEventArgs e)
{
GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx);
annot.Author = "GdPicture";
if (annot is GdPicture14.Annotations.AnnotationStickyNote ||
annot is GdPicture14.Annotations.AnnotationText)
{
GdViewer1.DisplayTextEditBox(e.AnnotationIdx);
}
}