MS DocView Done
This commit is contained in:
parent
4cd801003b
commit
fdd7ed40c0
@ -29,6 +29,7 @@ Public Class DocumentViewer
|
|||||||
Private _logger As Logger
|
Private _logger As Logger
|
||||||
|
|
||||||
Private _hide_file_info_from_user As Boolean = False
|
Private _hide_file_info_from_user As Boolean = False
|
||||||
|
Private _FilePath As String
|
||||||
|
|
||||||
' List of all created temp files when converting msg files
|
' List of all created temp files when converting msg files
|
||||||
Private _TempFiles As New List(Of String)
|
Private _TempFiles As New List(Of String)
|
||||||
@ -72,6 +73,7 @@ Public Class DocumentViewer
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
Public Sub Done()
|
Public Sub Done()
|
||||||
DeleteTempFiles()
|
DeleteTempFiles()
|
||||||
|
FreeFile()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
@ -87,7 +89,7 @@ Public Class DocumentViewer
|
|||||||
_logger.Info("Loading File {0}", FilePath)
|
_logger.Info("Loading File {0}", FilePath)
|
||||||
|
|
||||||
DoLoadFile(FilePath)
|
DoLoadFile(FilePath)
|
||||||
|
_FilePath = FilePath
|
||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -121,7 +123,27 @@ Public Class DocumentViewer
|
|||||||
Next
|
Next
|
||||||
_TempFiles.Clear()
|
_TempFiles.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub FreeFile()
|
||||||
|
Try
|
||||||
|
Dim oFileInfo = New IO.FileInfo(_FilePath)
|
||||||
|
Dim oExtension As String = oFileInfo.Extension.ToUpper
|
||||||
|
Select Case oExtension.ToUpper
|
||||||
|
Case ".MSG"
|
||||||
|
|
||||||
|
RichEditControl1.CreateNewDocument()
|
||||||
|
|
||||||
|
|
||||||
|
Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||||
|
RichEditControl1.CreateNewDocument()
|
||||||
|
Case ".XLSX", ".XLS", "CSV"
|
||||||
|
SpreadsheetControl1.CreateNewDocument()
|
||||||
|
Case Else
|
||||||
|
GdViewer.CloseDocument()
|
||||||
|
End Select
|
||||||
|
Catch ex As Exception
|
||||||
|
_logger.Warn($"Unexpected error in FreeFile: {ex.Message}")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
Private Sub DoLoadFile(FilePath As String)
|
Private Sub DoLoadFile(FilePath As String)
|
||||||
Try
|
Try
|
||||||
Dim oFileInfo = New IO.FileInfo(FilePath)
|
Dim oFileInfo = New IO.FileInfo(FilePath)
|
||||||
|
|||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.0.3.0")>
|
<Assembly: AssemblyVersion("1.0.4.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.4.0.0")>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user