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





In This Topic
GetDocumentType Method (GdViewer)
In This Topic
Returns the type of the document currently displayed in the GdViewer control.
Syntax
'Declaration
 
Public Function GetDocumentType() As DocumentType
public DocumentType GetDocumentType()
public function GetDocumentType(): DocumentType; 
public function GetDocumentType() : DocumentType;
public: DocumentType GetDocumentType(); 
public:
DocumentType GetDocumentType(); 

Return Value

A member of the DocumentType enumeration. The type of the displayed document.
Example
How to find out the type of the currently displayed document.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim message As String = "The current file is: " + GdViewer1.GetLastPath() + vbCrLf +
                            "The document type is: " + GdViewer1.GetDocumentType().ToString()
    MessageBox.Show(message, "GdViewer.GetDocumentType")
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetDocumentType")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    string message = "The current file is: " + GdViewer1.GetLastPath() +
                     "\nThe document type is: " + GdViewer1.GetDocumentType().ToString();
    MessageBox.Show(message, "GdViewer.GetDocumentType");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.GetDocumentType");
See Also