MyApplicationGlobix

This commit is contained in:
SchreiberM 2020-11-16 13:27:23 +01:00
parent 79872f048d
commit 2b8b96a762
5 changed files with 22 additions and 16 deletions

View File

@ -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))

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -140,6 +140,7 @@
<Compile Include="frmSearchStart.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Globix\State.vb" />
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@ -331,9 +332,7 @@
<ItemGroup>
<None Include="Resources\2_ZOO_FLOW_Abo_MouseOver.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Globix\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.