'Declaration
Public Event BeforeAnnotationAddedByUser As GdViewer.BeforeAnnotationAddedByUserHandler
public event GdViewer.BeforeAnnotationAddedByUserHandler BeforeAnnotationAddedByUser
public event BeforeAnnotationAddedByUser: GdViewer.BeforeAnnotationAddedByUserHandler;
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.BeforeAnnotationAddedByUserHandler* BeforeAnnotationAddedByUser
public: event GdViewer.BeforeAnnotationAddedByUserHandler^ BeforeAnnotationAddedByUser
Event Data
The event handler receives an argument of type GdViewer.BeforeAnnotationAddedByUserEventArgs containing data related to this event. The following GdViewer.BeforeAnnotationAddedByUserEventArgs 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) |
Remarks
Be aware, that this event only handles GdPicture/XMP annotations.
Example
How to utilize this event in your GdViewer control. This example shows you how to address the annotation before adding it to change its properties.
'We assume that the GdViewer1 control has been properly integrated 'and the BeforeAnnotationAddedByUser event has been properly added. 'Define the event. Sub GdViewer1_BeforeAnnotationAddedByUser(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.BeforeAnnotationAddedByUserEventArgs) Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx) If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote Then CType(annot, GdPicture14.Annotations.AnnotationStickyNote).FillColor = System.Drawing.Color.Beige End If End Sub
//We assume that the GdViewer1 control has been properly integrated //and the BeforeAnnotationAddedByUser event has been properly added. //Define the event. void GdViewer1_BeforeAnnotationAddedByUser(object sender, GdPicture14.WPF.GdViewer.BeforeAnnotationAddedByUserEventArgs e) { GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx); if (annot is GdPicture14.Annotations.AnnotationStickyNote) { ((GdPicture14.Annotations.AnnotationStickyNote)annot).FillColor = System.Drawing.Color.Beige; } }
See Also