Common: Disable Watcher when opmode = notappserver
This commit is contained in:
@@ -11,6 +11,7 @@ Namespace DocumentResultList
|
||||
|
||||
Private WithEvents FileOpenTimer As New Timer
|
||||
Private FileEx As Modules.Filesystem.File
|
||||
Private EnableWatching As Boolean = True
|
||||
|
||||
' TODO: Hashes for checking if the opened file was modified externally
|
||||
Private HashOriginalFile As String = Nothing
|
||||
@@ -47,8 +48,13 @@ Namespace DocumentResultList
|
||||
End Class
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyClass.New(pLogConfig, True)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pEnableWatching As Boolean)
|
||||
MyBase.New(pLogConfig)
|
||||
FileEx = New Modules.Filesystem.File(pLogConfig)
|
||||
EnableWatching = pEnableWatching
|
||||
End Sub
|
||||
|
||||
Public Async Function OpenDocument(pDocument As Document) As Task(Of Boolean)
|
||||
@@ -68,6 +74,11 @@ Namespace DocumentResultList
|
||||
Return False
|
||||
End If
|
||||
|
||||
If EnableWatching = False Then
|
||||
Logger.Debug("File was opened. Watching and Events are disabled.")
|
||||
Return True
|
||||
End If
|
||||
|
||||
Dim oProcessId = oResult.Item1
|
||||
Dim oFilePath = oResult.Item2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user