diff --git a/app/TaskFlow/My Project/AssemblyInfo.vb b/app/TaskFlow/My Project/AssemblyInfo.vb index 3551e0f..6d13b03 100644 --- a/app/TaskFlow/My Project/AssemblyInfo.vb +++ b/app/TaskFlow/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/TaskFlow/clsPatterns.vb b/app/TaskFlow/clsPatterns.vb index f943fd1..100d2d5 100644 --- a/app/TaskFlow/clsPatterns.vb +++ b/app/TaskFlow/clsPatterns.vb @@ -193,32 +193,29 @@ Public Class clsPatterns Public Shared Function ReplaceInternalValues(pInput As String) As String Dim oResult = pInput - Try - ' Replace Username(s) While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_USERNAME) - oResult = ReplacePattern(oResult, PATTERN_INT, USER_USERNAME) + oResult = ReplacePattern(oResult, PATTERN_INT, USER_USERNAME, INT_VALUE_USERNAME) End While - ' Replace Machinename(s) While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_MACHINE) - oResult = ReplacePattern(oResult, PATTERN_INT, Environment.MachineName) + oResult = ReplacePattern(oResult, PATTERN_INT, Environment.MachineName, INT_VALUE_MACHINE) End While - ' Replace Domainname(s) While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_DOMAIN) - oResult = ReplacePattern(oResult, PATTERN_INT, Environment.UserDomainName) + oResult = ReplacePattern(oResult, PATTERN_INT, Environment.UserDomainName, INT_VALUE_DOMAIN) End While - ' Replace CurrentDate(s) While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_DATE) - oResult = ReplacePattern(oResult, PATTERN_INT, Now.ToShortDateString) + oResult = ReplacePattern(oResult, PATTERN_INT, Now.ToShortDateString, INT_VALUE_DATE) End While + While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_WMDocID) - oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID) + oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID, INT_VALUE_WMDocID) End While + While ContainsPatternAndValue(oResult, PATTERN_INT, INT_VALUE_IDBID) - oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID) + oResult = ReplacePattern(oResult, PATTERN_INT, CURRENT_DOC_ID, INT_VALUE_IDBID) End While Return oResult @@ -644,7 +641,7 @@ Public Class clsPatterns Return results End Function - Public Shared Function ReplacePattern(input As String, type As String, replacement As String) As String + Public Shared Function ReplacePattern(input As String, type As String, replacement As String, Optional value As String = Nothing) As String Dim elements As MatchCollection = MyRegex.Matches(input) If IsNothing(replacement) Then @@ -652,14 +649,18 @@ Public Class clsPatterns End If For Each element As Match In elements - ' if group 1 contains the 'pattern' the replace whole group with 'replacement' - ' and return it - If element.Groups(1).Value = type Then - Return Regex.Replace(input, element.Groups(0).Value, replacement) + Dim matchType As String = element.Groups(1).Value + Dim matchValue As String = element.Groups(2).Value + + If matchType = type Then + ' ► Wenn ein Value angegeben wurde, nur exakt diesen ersetzen + If value IsNot Nothing AndAlso matchValue <> value Then + Continue For + End If + Return Regex.Replace(input, Regex.Escape(element.Groups(0).Value), replacement) End If Next - ' no replacement made Return input End Function diff --git a/app/TaskFlow/taskFLOW.vbproj b/app/TaskFlow/taskFLOW.vbproj index 4981e03..23f4bff 100644 --- a/app/TaskFlow/taskFLOW.vbproj +++ b/app/TaskFlow/taskFLOW.vbproj @@ -151,9 +151,8 @@ False - - False - ..\..\..\..\2_DLL Projekte\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll + + ..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll ..\..\..\..\2_DLL Projekte\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll @@ -935,6 +934,7 @@ frmMain.vb + Designer frmMain.vb