Example





In This Topic

PropertyChanged Event (AnnotationEditor)

In This Topic
This event is raised when an annotation property has been modified.

Please check the corresponded AnnotationEditor.PropertyChangedEventHandler for given parameters.

Syntax
'Declaration
 
Public Event PropertyChanged As AnnotationEditor.PropertyChangedEventHandler
public event AnnotationEditor.PropertyChangedEventHandler PropertyChanged
public event PropertyChanged: AnnotationEditor.PropertyChangedEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event AnnotationEditor.PropertyChangedEventHandler* PropertyChanged
public:
event AnnotationEditor.PropertyChangedEventHandler^ PropertyChanged
Example
How to add this event to your AnnotationEditor object.
'We assume that GdViewer1 control has been properly integrated in your application.
            
'Define and initialize the AnnotationEditor1 object.
Friend WithEvents AnnotationEditor1 As GdPicture14.AnnotationEditor
oAnnotEditor = New AnnotationEditor()
oAnnotEditor.InitFromAnnotationManager(GdViewer1.GetAnnotationManager())
            
'Add the event.
AddHandler AnnotationEditor1.PropertyChanged, AddressOf AnnotationEditor1_PropertyChanged
            
'Define the event.
Sub AnnotationEditor1_PropertyChanged(ByVal PropertyName As String, ByVal Reserved1 As String, ByVal Reserved2 As String, ByVal Reserved3 As String) Handles AnnotationEditor1_PropertyChanged
    Dim annotIdx As Integer = GdViewer1.GetSelectedAnnotationIdx()
    If annotIdx >= 0 Then
        Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(annotIdx)
        If GdViewer1.GetStat() <> GdPictureStatus.OK Then Throw New IndexOutOfRangeException()
        MessageBox.Show("The selected annotation index is: " + annotIdx + vbCrLf + "The changed property is: " + PropertyName, "AnnotationEditor.PropertyChanged")
    End If
End Sub
//We assume that the GdViewer1 control has been properly integrated in your application.
//Define and initialize the AnnotationEditor1 object.
AnnotationEditor AnnotationEditor1 = new AnnotationEditor();
AnnotationEditor1.InitFromAnnotationManager(GdViewer1.GetAnnotationManager());
            
//Add the event.
AnnotationEditor1.PropertyChanged += AnnotationEditor1_PropertyChanged;
            
//Define the event.
void AnnotationEditor1_PropertyChanged(string PropertyName, string Reserved1, string Reserved2, string Reserved3)
{
    int annotIdx = GdViewer1.GetSelectedAnnotationIdx();
    if (annotIdx >= 0)
    {
        GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(annotIdx);
        if (GdViewer1.GetStat() != GdPictureStatus.OK) throw new IndexOutOfRangeException();
        MessageBox.Show("The selected annotation index is: " + annotIdx + "\nThe changed property is: " + PropertyName, "AnnotationEditor.PropertyChanged");
    }
}
See Also