ZooFlow: clean up

This commit is contained in:
Jonathan Jenne 2021-01-19 16:23:19 +01:00
parent 4d8d00f6df
commit eb59a4e13d
3 changed files with 15 additions and 12 deletions

View File

@ -19,7 +19,7 @@ Public Class ClassFolderwatcher
FWFolderWatcher.EnableRaisingEvents = False
My.Application.Globix.Folderwatchstarted = False
'FolderWatch neu instanzieren
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
Logger.Info(" >> FolderWatch neu instanziert")
FWFolderWatcher.IncludeSubdirectories = False
FWFolderWatcher.EnableRaisingEvents = True
@ -56,12 +56,12 @@ Public Class ClassFolderwatcher
End Function
Public Function StartStop_FolderWatch()
Try
If My.Application.Globix.CURRENT_FOLDERWATCH = "" Then
If My.Application.Globix.CurrentFolderWatchPath = "" Then
'MsgBox("Bitte definieren Sie einen Überwachungsordner:", MsgBoxStyle.Exclamation)
Return False
End If
If FWFolderWatcher Is Nothing Then
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
Logger.Info(" >> FolderWatch Gestartet")
FWFolderWatcher.IncludeSubdirectories = False
FWFolderWatcher.EnableRaisingEvents = True
@ -75,7 +75,7 @@ Public Class ClassFolderwatcher
If FWFolderWatcher.EnableRaisingEvents = False Then
' Dim watcher As New FileSystemWatcher()
' watcher.Path = CURRENT_FOLDERWATCH
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
Logger.Info(" >> FolderWatch Gestartet")
FWFolderWatcher.IncludeSubdirectories = False
FWFolderWatcher.EnableRaisingEvents = True
@ -97,6 +97,7 @@ Public Class ClassFolderwatcher
End If
Catch ex As Exception
Logger.Error(ex.Message)
MsgBox("Error in StartStop_FolderWatch:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return 99
End Try
@ -118,7 +119,7 @@ Public Class ClassFolderwatcher
End If
End If
If FWScan Is Nothing Then
FWScan = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_SCAN_FOLDERWATCH, "*.*")
FWScan = New FileSystemWatcher(My.Application.Globix.CURRENT_SCAN_FOLDERWATCH, "*.*")
Logger.Info(" >> FolderWatch Scan Gestartet")
FWScan.IncludeSubdirectories = False
FWScan.EnableRaisingEvents = True
@ -149,6 +150,7 @@ Public Class ClassFolderwatcher
End If
Catch ex As Exception
Logger.Error(ex.Message)
MsgBox("Error in StartStop_FolderWatchSCAN:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return 99
End Try
@ -194,6 +196,7 @@ Public Class ClassFolderwatcher
End If
Catch ex As Exception
Logger.Error(ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in folder_watch_Created")
End Try

View File

@ -9,7 +9,7 @@ Namespace Globix
Public Property TEMP_FILES As List(Of String) = New List(Of String)
Public Property CurrMessageID As String
Public Property CURRENT_FILENAME As String
Public Property CURRENT_FOLDERWATCH As String
Public Property CurrentFolderWatchPath As String
Public Property CURRENT_SCAN_FOLDERWATCH As String
Public Property CURRENT_WORKFILE_GUID As Long
Public Property CURRENT_WORKFILE As String

View File

@ -45,7 +45,7 @@ Public Class frmGlobixBasicConfig
'SaveConfigValue("FW_started", "False")
My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save()
My.Application.Globix.CURRENT_FOLDERWATCH = ""
My.Application.Globix.CurrentFolderWatchPath = ""
End If
Exit Sub
@ -81,8 +81,8 @@ Public Class frmGlobixBasicConfig
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = folderwatch
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
Else
My.Application.Globix.CURRENT_FOLDERWATCH = folderwatch
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
My.Application.Globix.CurrentFolderWatchPath = folderwatch
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
End If
End If
If My.Application.Globix.Folderwatchstarted = True And FOLDER_TYPE = "DEFAULT" Then
@ -104,14 +104,14 @@ Public Class frmGlobixBasicConfig
oReload = True
Dim oFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId)
If Not oFolderwatch Is Nothing Then
My.Application.Globix.CURRENT_FOLDERWATCH = oFolderwatch
My.Application.Globix.CurrentFolderWatchPath = oFolderwatch
End If
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
Dim oSCANFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId)
If Not oSCANFolderwatch Is Nothing Then
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch
End If
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
If Not ClassFolderwatcher.FWFolderWatcher Is Nothing Then