Common/DocumentResultList: Handle file open, Update file with respect to Doctype options
This commit is contained in:
@@ -28,6 +28,7 @@ Namespace DocumentResultList
|
||||
Private ReadOnly ProcessedFiles As New List(Of OpenFile)
|
||||
|
||||
Public Event FileChanged As EventHandler(Of FileChangedArgs)
|
||||
Public Event FileOpened As EventHandler(Of FileOpenedArgs)
|
||||
|
||||
Public Class OpenFile
|
||||
Public Document As Document
|
||||
@@ -40,6 +41,10 @@ Namespace DocumentResultList
|
||||
Public File As OpenFile
|
||||
End Class
|
||||
|
||||
Public Class FileOpenedArgs
|
||||
Public File As OpenFile
|
||||
End Class
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig)
|
||||
FileEx = New Modules.Filesystem.File(pLogConfig)
|
||||
@@ -67,14 +72,19 @@ Namespace DocumentResultList
|
||||
|
||||
Logger.Debug("File [{0}] opened with ProcessId [{1}]", oFilePath, oProcess.Id)
|
||||
|
||||
OpenFiles.Add(New OpenFile With {
|
||||
Dim oOpenFile = New OpenFile With {
|
||||
.Document = pDocument,
|
||||
.FilePath = oFilePath,
|
||||
.ProcessId = oProcess.Id
|
||||
})
|
||||
}
|
||||
OpenFiles.Add(oOpenFile)
|
||||
|
||||
RaiseEvent FileOpened(Me, New FileOpenedArgs With {.File = oOpenFile})
|
||||
|
||||
If FileOpenTimer.Enabled = False Then
|
||||
' Waiting a while before actually starting the timer to allow for
|
||||
' opening the file without checking for use already.
|
||||
Await Task.Delay(FILE_OPEN_HANDLE_INTERVAL)
|
||||
FileOpenTimer.Interval = FILE_OPEN_HANDLE_INTERVAL
|
||||
FileOpenTimer.Start()
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user