EDMIService: WIP
This commit is contained in:
@@ -94,6 +94,7 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceUserValues(pInput As String, pUser As State.UserState) As String
|
||||
Logger.Debug("Replacing User Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oModule = GetModule(Of Modules.User)()
|
||||
@@ -104,9 +105,10 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceFileValues(pInput As String, pFileInfo As FileInfo) As String
|
||||
Logger.Debug("Replacing File Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oModule = GetModule(Of Modules.User)()
|
||||
Dim oModule = GetModule(Of Modules.FileInformation)()
|
||||
Dim oArgs = GetReplaceMapForModule(oModule, pFileInfo:=pFileInfo)
|
||||
oResult = DoReplaceForModule(oResult, oModule, oArgs)
|
||||
|
||||
@@ -114,6 +116,7 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceControlValues(pInput As String, pPanel As Panel) As String
|
||||
Logger.Debug("Replacing Control Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oModule = GetModule(Of Modules.Controls)()
|
||||
@@ -124,6 +127,7 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceWindreamValues(pInput As String, pWMObject As WMObject) As String
|
||||
Logger.Debug("Replacing Windream Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oModule = GetModule(Of Modules.Windream)()
|
||||
@@ -134,6 +138,7 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceInternalValues(pInput As String) As String
|
||||
Logger.Debug("Replacing Internal Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oInternalModule = GetModule(Of Modules.Internal)()
|
||||
@@ -148,6 +153,7 @@ Public Class Patterns2
|
||||
End Function
|
||||
|
||||
Public Function ReplaceGlobixValues(pInput As String, pGlobixIndexes As Dictionary(Of String, List(Of String))) As String
|
||||
Logger.Debug("Replacing Globix Values")
|
||||
Dim oResult = pInput
|
||||
|
||||
Dim oGlobixModule = GetModule(Of Modules.Globix)()
|
||||
@@ -161,6 +167,12 @@ Public Class Patterns2
|
||||
|
||||
Private Function DoReplaceForModule(pInput As String, pModule As IModule, pArgs As Dictionary(Of String, Object)) As String
|
||||
Try
|
||||
If pModule IsNot Nothing AndAlso pModule?.GetType?.Name IsNot Nothing Then
|
||||
Logger.Debug("Calling Replace for Module [{0}]", pModule.GetType.Name)
|
||||
End If
|
||||
|
||||
Logger.Debug("Calling Replace for Input String [{0}]", pInput)
|
||||
|
||||
pInput = pModule.Replace(pInput, pArgs)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Placeholders for String [{0}] could not be replaced completely in Module [{1}]. Skipping.", pInput, pModule.GetType.Name)
|
||||
@@ -186,6 +198,7 @@ Public Class Patterns2
|
||||
Dim oArgs As New Dictionary(Of String, Object)
|
||||
|
||||
If TypeOf pModule Is Modules.Clipboard Then
|
||||
Logger.Debug("Adding Arguments for Clipboard Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.Clipboard.CLIP_VALUE_BOARD, My.Computer.Clipboard.GetText())
|
||||
Catch ex As Exception
|
||||
@@ -193,6 +206,7 @@ Public Class Patterns2
|
||||
End Try
|
||||
|
||||
ElseIf TypeOf pModule Is Modules.FileInformation Then
|
||||
Logger.Debug("Adding Arguments for File Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.FileInformation.FILE_VALUE_FILEINFO, pFileInfo)
|
||||
Catch ex As Exception
|
||||
@@ -200,6 +214,7 @@ Public Class Patterns2
|
||||
End Try
|
||||
|
||||
ElseIf TypeOf pModule Is Modules.User Then
|
||||
Logger.Debug("Adding Arguments for User Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_EMAIL, pUser.Email)
|
||||
oArgs.Add(Patterns.Modules.User.USER_VALUE_LANGUAGE, pUser.Language)
|
||||
@@ -213,6 +228,7 @@ Public Class Patterns2
|
||||
End Try
|
||||
|
||||
ElseIf TypeOf pModule Is Modules.Controls Then
|
||||
Logger.Debug("Adding Arguments for Controls Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.Controls.CTRL_VALUE_PANEL, pPanel)
|
||||
Catch ex As Exception
|
||||
@@ -220,6 +236,7 @@ Public Class Patterns2
|
||||
End Try
|
||||
|
||||
ElseIf TypeOf pModule Is Modules.Windream Then
|
||||
Logger.Debug("Adding Arguments for Windream Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.Windream.WM_VALUE_DOCUMENT, pWMObject)
|
||||
Catch ex As Exception
|
||||
@@ -227,6 +244,7 @@ Public Class Patterns2
|
||||
End Try
|
||||
|
||||
ElseIf TypeOf pModule Is Modules.Globix Then
|
||||
Logger.Debug("Adding Arguments for Globix Module")
|
||||
Try
|
||||
oArgs.Add(Patterns.Modules.Globix.GBX_VALUE_INDICIES, pGlobixIndexes)
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user