diff --git a/Controls.DocumentViewer/DocumentViewer.vb b/Controls.DocumentViewer/DocumentViewer.vb index 0e8e5cf5..99ec7e0d 100644 --- a/Controls.DocumentViewer/DocumentViewer.vb +++ b/Controls.DocumentViewer/DocumentViewer.vb @@ -489,6 +489,7 @@ Public Class DocumentViewer End Sub Private Function DoLoadFile(FilePath As String) As Boolean Try + _logger.Debug($"DoLoadFile - Try loading file: {FilePath}") Dim oFileInfo = New FileInfo(FilePath) Dim oExtension As String = oFileInfo.Extension.ToUpper @@ -499,7 +500,7 @@ Public Class DocumentViewer SpreadsheetControl1.Visible = False SpreadsheetControl1.Dock = DockStyle.None - + _logger.Debug($"DoLoadFile - oExtension: {oExtension}") Select Case oExtension.ToUpper Case ".MSG" Dim oEmlPath As String = _email.Convert_ToEml(FilePath) @@ -523,12 +524,13 @@ Public Class DocumentViewer SpreadsheetControl1.Dock = DockStyle.Fill Case Else + _logger.Debug($"DoLoadFile - Else-Teil - GDViewer will be used...") GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter GdViewer.ForceTemporaryMode = True GdViewer.AnnotationDropShadow = True - - If GdViewer.DisplayFromFile(FilePath) <> GdPictureStatus.OK Then + Dim oGDPictureStatus As GdPictureStatus = GdViewer.DisplayFromFile(FilePath) + If oGDPictureStatus <> GdPictureStatus.OK Then Dim oFileName = IO.Path.GetFileName(FilePath) lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName) lbFileNotLoaded.Visible = True @@ -540,6 +542,7 @@ Public Class DocumentViewer Return True Catch ex As Exception + _logger.Warn($"Unexpected Error in DoLoadFile - ErrorMessage: {ex.Message}") _logger.Error(ex) Return False End Try diff --git a/Controls.DocumentViewer/My Project/AssemblyInfo.vb b/Controls.DocumentViewer/My Project/AssemblyInfo.vb index e2b71e14..013c511e 100644 --- a/Controls.DocumentViewer/My Project/AssemblyInfo.vb +++ b/Controls.DocumentViewer/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +