Interfaces: Version 1.5.1
This commit is contained in:
@@ -21,6 +21,9 @@ Public Class DocumentPropertyMenu
|
||||
Public Const COPY_PATH As String = "Dateipfad kopieren"
|
||||
Public Const OPEN_PROPERTIES As String = "Eigenschaften"
|
||||
|
||||
Public Event FileOpened As EventHandler(Of String)
|
||||
Public Event FileClosed As EventHandler(Of String)
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Client As Client, FilePath As String, Optional ObjectId As Long = 0)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
@@ -99,7 +102,22 @@ Public Class DocumentPropertyMenu
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Process.Start(_FilePath)
|
||||
Using oProc As New Process
|
||||
Try
|
||||
oProc.StartInfo.FileName = _FilePath
|
||||
oProc.EnableRaisingEvents = True
|
||||
AddHandler oProc.Exited, AddressOf Handle_OpenFile
|
||||
|
||||
oProc.Start(_FilePath)
|
||||
RaiseEvent FileOpened(Me, _FilePath)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Public Sub Handle_OpenFile(sender As Object, e As EventArgs)
|
||||
RaiseEvent FileClosed(Me, _FilePath)
|
||||
End Sub
|
||||
|
||||
Public Sub OpenFolder_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Reference in New Issue
Block a user