Common: Rework of DocumentResultList WIP
This commit is contained in:
51
GUIs.Common/DocumentResultList/Opener.vb
Normal file
51
GUIs.Common/DocumentResultList/Opener.vb
Normal file
@@ -0,0 +1,51 @@
|
||||
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
|
||||
Reference in New Issue
Block a user