GdPicture.NET.14.API
GdPicture14 Namespace / AnnotationManager Class / GetStat Method
Example





In This Topic
GetStat Method (AnnotationManager)
In This Topic
Returns the status of the last executed operation with the current AnnotationManager object.
Syntax
'Declaration
 
Public Function GetStat() As GdPictureStatus
public GdPictureStatus GetStat()
public function GetStat(): GdPictureStatus; 
public function GetStat() : GdPictureStatus;
public: GdPictureStatus GetStat(); 
public:
GdPictureStatus GetStat(); 

Return Value

A member of the GdPictureStatus enumeration. If the last executed AnnotationManager method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Use this method in the combination with all those, which return a value instead of a status, such as AnnotationManager.GetAnnotationCount method in the example below.
Example
How to retrieve the status of the last executed method.
Dim annotationManager As AnnotationManager = New AnnotationManager()
Dim status As GdPictureStatus = annotationManager.InitFromFile("test.jpg")
If status = GdPictureStatus.OK Then
    status = annotationManager.SelectPage(1)
    If status = GdPictureStatus.OK Then
        Dim annotCount As Integer = annotationManager.GetAnnotationCount()
        status = annotationManager.GetStat()
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The number of annotations: " + annotCount.ToString(), "AnnotationManager.GetStat")
        Else
            MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + status.ToString(), "AnnotationManager.GetStat")
        End If
    Else
        MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), "AnnotationManager.GetStat")
    End If
    annotationManager.Close()
Else
    MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + status.ToString(), "AnnotationManager.GetStat")
End If
annotationManager.Dispose()
AnnotationManager annotationManager = new AnnotationManager();
GdPictureStatus status = annotationManager.InitFromFile("test.jpg");
if (status == GdPictureStatus.OK)
{
    status = annotationManager.SelectPage(1);
    if (status == GdPictureStatus.OK)
    {
        int annotCount = annotationManager.GetAnnotationCount();
        status = annotationManager.GetStat();
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The number of annotations: " + annotCount.ToString(), "AnnotationManager.GetStat");
        }
        else
            MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + status.ToString(), "AnnotationManager.GetStat");
    }
    else
        MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), "AnnotationManager.GetStat");
    annotationManager.Close();
}
else
    MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + status.ToString(), "AnnotationManager.GetStat");
annotationManager.Dispose();
See Also