GdPicture.NET.14
GdPicture14.WPF Namespace / GdViewer Class / AnnotationEndEditingText Event
Example





In This Topic
AnnotationEndEditingText Event (GdViewer)
In This Topic
This event is raised when the user has finished editing the content of the sticky note or text GdPicture/XMP annotations by leaving the editable dialogue box.

The event makes use of bubble routing strategy. Please check the corresponded GdViewer.AnnotationEndEditingTextEventArgs for given parameters.

Syntax
'Declaration
 
Public Event AnnotationEndEditingText As GdViewer.AnnotationEndEditingTextHandler
public event GdViewer.AnnotationEndEditingTextHandler AnnotationEndEditingText
public event AnnotationEndEditingText: GdViewer.AnnotationEndEditingTextHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.AnnotationEndEditingTextHandler* AnnotationEndEditingText
public:
event GdViewer.AnnotationEndEditingTextHandler^ AnnotationEndEditingText
Event Data

The event handler receives an argument of type GdViewer.AnnotationEndEditingTextEventArgs containing data related to this event. The following GdViewer.AnnotationEndEditingTextEventArgs properties provide information specific to this event.

PropertyDescription
The 0-based index of the selected annotation within the current page of the displayed document. It is a value from 0 to GetAnnotationCount-1.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
Remarks
Be aware, that this event only handles GdPicture/XMP annotations, specifically sticky note and text annotations.
Example
How to utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the AnnotationEndEditingText event has been properly added.
            
'Define the event.
Sub GdViewer1_AnnotationEndEditingText(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.AnnotationEndEditingTextEventArgs)
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
    Dim text As String = ""
    If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationStickyNote)).Text
    ElseIf TypeOf annot Is GdPicture14.Annotations.AnnotationText Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationText)).Text
    End If
    MessageBox.Show(text, "GdViewer.AnnotationEndEditingText")
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the AnnotationEndEditingText event has been properly added.
            
//Define the event.
void GdViewer1_AnnotationEndEditingText(object sender, GdPicture14.WPF.GdViewer.AnnotationEndEditingTextEventArgs e)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(e.AnnotationIdx);
    string text = "";
    if (annot is GdPicture14.Annotations.AnnotationStickyNote)
        text = ((GdPicture14.Annotations.AnnotationStickyNote)annot).Text;
    else if (annot is GdPicture14.Annotations.AnnotationText)
        text = ((GdPicture14.Annotations.AnnotationText)annot).Text;
    MessageBox.Show(text, "GdViewer.AnnotationEndEditingText");
}
See Also