GdPicture.NET.14
GdPicture14.WPF Namespace / GdViewer Class / GetStat Method
Example





In This Topic
GetStat Method (GdViewer)
In This Topic
Returns the status of the last executed operation with this GdViewer control.
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 GdViewer 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 GetAnnotationCount method in the example below.
Example
How to retrieve the status of the last executed method.
'We assume that the GdViewer1 control has been properly integrated.
Dim annotCount As Integer = GdViewer1.GetAnnotationCount()
'Use the GetStat() method here to find the reason for the failure.
Dim status As GdPictureStatus = GdViewer1.GetStat()
If status = GdPictureStatus.OK Then
    MessageBox.Show("The number of annotations: " + annotCount.ToString(), "GdViewer.GetStat")
Else
    MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + status.ToString(), "GdViewer.GetStat")
End If
//We assume that the GdViewer1 control has been properly integrated.
int annotCount = GdViewer1.GetAnnotationCount();
//Use the GetStat() method here to find the reason for the failure.
GdPictureStatus status = GdViewer1.GetStat();
if (status == GdPictureStatus.OK)
{
    MessageBox.Show("The number of annotations: " + annotCount.ToString(), "GdViewer.GetStat");
}
else
{
    MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + status.ToString(), "GdViewer.GetStat");
}
See Also