2022-01-18 13:27:34 +01:00

51 lines
1.3 KiB
VB.net

Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow.Base
Namespace DocumentResultList
Public Class Opener
Inherits BaseClass
Public Sub New(pLogConfig As LogConfig)
MyBase.New(pLogConfig)
End Sub
Public Sub OpenDocument(pDocument As Document)
Dim oProcessId As Integer = Nothing
If pDocument.FullPath Is Nothing OrElse pDocument.FullPath.Trim = String.Empty Then
oProcessId = OpenFileFromPath(pDocument)
ElseIf pDocument.Extension IsNot Nothing AndAlso pDocument.Contents IsNot Nothing Then
End If
End Sub
Private Function OpenFileFromByteArry(pDocument As Document) As Integer
Try
' TODO: Open file from temp folder
Dim oTempPath = IO.Path.GetTempPath()
Catch ex As Exception
End Try
End Function
Private Function OpenFileFromPath(pDocument As Document) As Integer
Try
Dim oProcess = Process.Start(New ProcessStartInfo With {
.FileName = pDocument.FullPath
})
Return oProcess.Id
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class
End Namespace