DocumentViewer: Hide file not loaded label properly
This commit is contained in:
parent
d7c3a35eb0
commit
d769173d68
@ -55,7 +55,7 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
Private _FileStream As Stream
|
Private _FileStream As Stream
|
||||||
Private _FilePath As String
|
Private _FilePath As String
|
||||||
Private _Fileinfo As FileInfo
|
Private _FileInfo As FileInfo
|
||||||
Private _FileLoadMode As FileLoadMode = FileLoadMode.File
|
Private _FileLoadMode As FileLoadMode = FileLoadMode.File
|
||||||
|
|
||||||
' List of all created temp files when converting msg files
|
' List of all created temp files when converting msg files
|
||||||
@ -109,12 +109,12 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
_FilePath = FilePath
|
_FilePath = FilePath
|
||||||
_FileLoadMode = FileLoadMode.File
|
_FileLoadMode = FileLoadMode.File
|
||||||
_Fileinfo = New FileInfo(FilePath)
|
_FileInfo = New FileInfo(FilePath)
|
||||||
|
|
||||||
_logger.Info("Loading File [{0}] from Filesystem", FilePath)
|
_logger.Info("Loading File [{0}] from Filesystem", FilePath)
|
||||||
FileLoaded = DoLoadFile(FilePath)
|
FileLoaded = DoLoadFile(FilePath)
|
||||||
|
|
||||||
SetViewerMode(_Fileinfo.Extension)
|
SetViewerMode(_FileInfo.Extension)
|
||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -141,10 +141,6 @@ Public Class DocumentViewer
|
|||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SearchFile(pSearchQuery As String)
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Terminate Viewer, freeing up resources and deleting temp files
|
''' Terminate Viewer, freeing up resources and deleting temp files
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@ -180,8 +176,6 @@ Public Class DocumentViewer
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function Save() As Boolean
|
Public Function Save() As Boolean
|
||||||
Dim oSaveResult As GdPictureStatus = GdPictureStatus.OK
|
Dim oSaveResult As GdPictureStatus = GdPictureStatus.OK
|
||||||
|
|
||||||
@ -204,6 +198,11 @@ Public Class DocumentViewer
|
|||||||
Public Sub CloseDocument()
|
Public Sub CloseDocument()
|
||||||
Try
|
Try
|
||||||
GdViewer.CloseDocument()
|
GdViewer.CloseDocument()
|
||||||
|
|
||||||
|
_FileInfo = Nothing
|
||||||
|
_FilePath = Nothing
|
||||||
|
_FileStream = Nothing
|
||||||
|
|
||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex)
|
_logger.Error(ex)
|
||||||
@ -449,10 +448,10 @@ Public Class DocumentViewer
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub FreeFile()
|
Private Sub FreeFile()
|
||||||
Try
|
Try
|
||||||
If Len(_FilePath) = 0 OrElse _Fileinfo Is Nothing Then
|
If Len(_FilePath) = 0 OrElse _FileInfo Is Nothing Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
Dim oExtension As String = _Fileinfo.Extension.ToUpper
|
Dim oExtension As String = _FileInfo.Extension.ToUpper
|
||||||
Select Case _ViewerMode
|
Select Case _ViewerMode
|
||||||
Case ViewerMode.RichText
|
Case ViewerMode.RichText
|
||||||
_logger.Debug("Closing RichText Editor")
|
_logger.Debug("Closing RichText Editor")
|
||||||
@ -641,6 +640,10 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
If _FileStream Is Nothing And _FilePath Is Nothing Then
|
||||||
|
lbFileNotLoaded.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
Select Case _ViewerMode
|
Select Case _ViewerMode
|
||||||
Case ViewerMode.GDPicture
|
Case ViewerMode.GDPicture
|
||||||
buttonPrint.Enabled = True
|
buttonPrint.Enabled = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user