From 2b8b96a762a432ec34ff63d342743b07c78692cd Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Mon, 16 Nov 2020 13:27:23 +0100 Subject: [PATCH] MyApplicationGlobix --- GUIs.ZooFlow/ClassFilehandle.vb | 14 +++++++------- GUIs.ZooFlow/ClassInit.vb | 4 ++-- GUIs.ZooFlow/Globix/State.vb | 9 +++++++++ GUIs.ZooFlow/MyApplication.vb | 6 ++---- GUIs.ZooFlow/ZooFlow.vbproj | 5 ++--- 5 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 GUIs.ZooFlow/Globix/State.vb diff --git a/GUIs.ZooFlow/ClassFilehandle.vb b/GUIs.ZooFlow/ClassFilehandle.vb index bb52e953..6d85c4bc 100644 --- a/GUIs.ZooFlow/ClassFilehandle.vb +++ b/GUIs.ZooFlow/ClassFilehandle.vb @@ -24,7 +24,7 @@ Public Class ClassFilehandle Public Function Decide_FileHandle(filename As String, handletype As String) Try If filename.EndsWith(".msg") Then - My.Application.CurrMessageID = "" + My.Application.Globix.CurrMessageID = "" Dim _msg As New Msg.Message(filename) If _msg.Attachments.Count > 0 Then Dim result As MsgBoxResult @@ -72,12 +72,12 @@ Public Class ClassFilehandle Dim msg As New Msg.Message(msgname) If Not msg.InternetMessageId Is Nothing Then - My.Application.CurrMessageID = msg.InternetMessageId + My.Application.Globix.CurrMessageID = msg.InternetMessageId Else _LOGGER.Info(">> Email_Decay: Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!") Dim sGUID As String sGUID = System.Guid.NewGuid.ToString() - My.Application.CurrMessageID = sGUID + My.Application.Globix.CurrMessageID = sGUID End If 'Nur die MSGDatei ablegen @@ -90,7 +90,7 @@ Public Class ClassFilehandle _msgEXAtt.Attachments.Clear() _msgEXAtt.Save(tempfile) 'Datei in Array zum Templöschen speichern - My.Application.TEMP_FILES.Add(tempfile) + My.Application.Globix.TEMP_FILES.Add(tempfile) If Insert_GI_File(tempfile, msgonly) = True Then erfolgreich = True @@ -117,7 +117,7 @@ Public Class ClassFilehandle If tempfile <> String.Empty Then Dim oMessage = attachment.EmbeddedMessage oMessage.Save(tempfile) - My.Application.TEMP_FILES.Add(tempfile) + My.Application.Globix.TEMP_FILES.Add(tempfile) _LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile) erfolgreich = Insert_GI_File(tempfile, ATT_EXTR) i1 += 1 @@ -130,7 +130,7 @@ Public Class ClassFilehandle If tempfile <> "" Then attachment.Save(tempfile) 'Datei in Array zum Templöschen speichern - My.Application.TEMP_FILES.Add(tempfile) + My.Application.Globix.TEMP_FILES.Add(tempfile) _LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile) 'nun der Insert des Anhanges erfolgreich = Insert_GI_File(tempfile, ATT_EXTR) @@ -229,7 +229,7 @@ Public Class ClassFilehandle ' sFilename = sFilename.Replace("..", ".") 'End If ' alle nicht zulässigen Zeichen ersetzen - sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, My.Application.GI_REGEX_CLEAN_FILENAME, REPLACEChar) + sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, My.Application.Globix.REGEX_CLEAN_FILENAME, REPLACEChar) sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, "[\\/:*?""<>|\r\n]", "", System.Text.RegularExpressions.RegexOptions.Singleline) 'Dim oCleanFileName As String = String.Join(REPLACEChar, sFilename.Split(Path.GetInvalidFileNameChars())) Dim oCleanFileName As New System.IO.FileInfo(System.Text.RegularExpressions.Regex.Replace(sFilename, String.Format("[{0}]", String.Join(String.Empty, Path.GetInvalidFileNameChars)), REPLACEChar)) diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index 48080dbd..90130c98 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -37,7 +37,7 @@ Public Class ClassInit oInit.AddStep("Initializing User..", AddressOf InitializeUser, True) oInit.AddStep("Initializing IDB..", AddressOf InitializeIDB, True) oInit.AddStep("Loading 3rd-party licenses", AddressOf Initialize3rdParty, False) - oInit.AddStep("Loading basic Configs", AddressOf Initialize3rdParty, False) + oInit.AddStep("Loading basic Configs", AddressOf InitBasicData, False) ' === Init Schritte definieren AddHandler oInit.ProgressChanged, AddressOf ProgressChanged @@ -116,7 +116,7 @@ Public Class ClassInit Private Sub InitBasicData(MyApplication As My.MyApplication) Try Dim oSql = "SELECT * FROM TBGI_FUNCTION_REGEX" - My.Application.GI_DT_FUNCTION_REGEX = My.Database.GetDatatable(oSql) + My.Application.Globix.DT_FUNCTION_REGEX = My.Database.GetDatatable(oSql) diff --git a/GUIs.ZooFlow/Globix/State.vb b/GUIs.ZooFlow/Globix/State.vb new file mode 100644 index 00000000..795dfc42 --- /dev/null +++ b/GUIs.ZooFlow/Globix/State.vb @@ -0,0 +1,9 @@ +Namespace Globix + Public Class State + Public Property DT_FUNCTION_REGEX As DataTable + Public Property REGEX_CLEAN_FILENAME As String = "[?*^""<>|]" + Public Property TEMP_FILES As List(Of String) = New List(Of String) + Public Property CurrMessageID As String + End Class +End Namespace + diff --git a/GUIs.ZooFlow/MyApplication.vb b/GUIs.ZooFlow/MyApplication.vb index a4c7eea3..7e4fd7fb 100644 --- a/GUIs.ZooFlow/MyApplication.vb +++ b/GUIs.ZooFlow/MyApplication.vb @@ -46,11 +46,9 @@ Namespace My Public Property ModulesActive As New List(Of String) Public Property ClipboardWatcher As New ClipboardWatcher.State Public Property IDB_ConnectionString As String - Public Property CurrMessageID As String + Public Property Globix As New Globix.State + - Public Property GI_DT_FUNCTION_REGEX As DataTable - Public Property GI_REGEX_CLEAN_FILENAME As String = "[?*^""<>|]" - Public Property TEMP_FILES As List(Of String) = New List(Of String) End Class End Namespace diff --git a/GUIs.ZooFlow/ZooFlow.vbproj b/GUIs.ZooFlow/ZooFlow.vbproj index f6b3b44f..3f0b381f 100644 --- a/GUIs.ZooFlow/ZooFlow.vbproj +++ b/GUIs.ZooFlow/ZooFlow.vbproj @@ -140,6 +140,7 @@ Form + True True @@ -331,9 +332,7 @@ - - - +