DocumentViewer: Better logging
This commit is contained in:
parent
edcb549d55
commit
5ff6a42a2f
@ -69,14 +69,19 @@ Public Class DocumentViewer
|
||||
''' Terminate Viewer, freeing up resources and deleting temp files
|
||||
''' </summary>
|
||||
Public Sub Done()
|
||||
_logger.Debug("Done: Deleting Temp Files")
|
||||
DeleteTempFiles()
|
||||
Try
|
||||
_logger.Debug("Done: Deleting Temp Files")
|
||||
DeleteTempFiles()
|
||||
|
||||
_logger.Debug("Done: Closing Documents")
|
||||
FreeFile()
|
||||
_logger.Debug("Done: Closing Documents")
|
||||
FreeFile()
|
||||
|
||||
_logger.Debug("Done: Triggering GC")
|
||||
GC.Collect()
|
||||
_logger.Debug("Done: Triggering GC")
|
||||
GC.Collect()
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Error while cleaning up DocumentViewer")
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@ -125,8 +130,12 @@ Public Class DocumentViewer
|
||||
End Sub
|
||||
|
||||
Public Sub CloseDocument()
|
||||
GdViewer.CloseDocument()
|
||||
UpdateMainUi()
|
||||
Try
|
||||
GdViewer.CloseDocument()
|
||||
UpdateMainUi()
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub DeleteTempFiles()
|
||||
@ -162,13 +171,16 @@ Public Class DocumentViewer
|
||||
Dim oExtension As String = _Fileinfo.Extension.ToUpper
|
||||
Select Case _ViewerMode
|
||||
Case ViewerMode.RichText
|
||||
_logger.Debug("Closing RichText Editor")
|
||||
RichEditControl1.CreateNewDocument()
|
||||
|
||||
Case ViewerMode.Excel
|
||||
_logger.Debug("Closing Excel Editor")
|
||||
SpreadsheetControl1.CreateNewDocument()
|
||||
|
||||
Case Else
|
||||
GdViewer.CloseDocument()
|
||||
_logger.Debug("Closing GDPicture Viewer")
|
||||
GdViewer.Dispose()
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user