diff --git a/CompuMaster.TaskManagement.UI.WinForms/CompuMaster.TaskManagement.UI.WinForms.vbproj b/CompuMaster.TaskManagement.UI.WinForms/CompuMaster.TaskManagement.UI.WinForms.vbproj index 6c506f4..265a489 100644 --- a/CompuMaster.TaskManagement.UI.WinForms/CompuMaster.TaskManagement.UI.WinForms.vbproj +++ b/CompuMaster.TaskManagement.UI.WinForms/CompuMaster.TaskManagement.UI.WinForms.vbproj @@ -46,13 +46,6 @@ - - - True - \ - - - diff --git a/CompuMaster.TaskManagement.UI.WinForms/MultiTaskProgessForm.vb b/CompuMaster.TaskManagement.UI.WinForms/MultiTaskProgessForm.vb index 6b1c792..d3b9a71 100644 --- a/CompuMaster.TaskManagement.UI.WinForms/MultiTaskProgessForm.vb +++ b/CompuMaster.TaskManagement.UI.WinForms/MultiTaskProgessForm.vb @@ -67,11 +67,11 @@ Public Class MultiTaskProgessForm With Nothing Dim ETA = Me.TaskBundle.EstimatedTimeOfArrival If ETA.HasValue Then - NewFormTitle &= " - ETA: " & ETA.Value.ToString("d\.hh\:mm\:ss") + NewFormTitle &= " - ETA: " & ETA.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) Else Dim ETR = Me.TaskBundle.EstimatedTimeToRun If ETR.HasValue Then - NewFormTitle &= " - ETA: " & ETR.Value.ToString("d\.hh\:mm\:ss") + NewFormTitle &= " - ETA: " & ETR.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) End If End If End With @@ -146,7 +146,7 @@ Public Class MultiTaskProgessForm Private Sub UpdateProgressBar(control As ProgressingTaskControl, taskItem As ProgressingTaskItem) Dim ProgressMaximum As Integer = taskItem.TotalStepsCount * 100 Dim StepProgressValue As Integer = If(taskItem.RunningStep?.EstimatedTimeToRun.HasValue AndAlso taskItem.RunningStep?.ConsumedTime.HasValue, System.Math.Min(100, CInt(taskItem.RunningStep.ConsumedTime.Value.TotalSeconds / taskItem.RunningStep.EstimatedTimeToRun.Value.TotalSeconds * 100)), 0) - Dim StepProgressValueText As String = If(taskItem.RunningStep?.EstimatedTimeToRun.HasValue, " (ca. " & StepProgressValue.ToString() & " %)", "") + Dim StepProgressValueText As String = If(taskItem.RunningStep?.EstimatedTimeToRun.HasValue, " (ca. " & StepProgressValue.ToString(System.Globalization.CultureInfo.InvariantCulture) & " %)", "") Dim NewProgressValue As Integer = System.Math.Min(ProgressMaximum, taskItem.RunningTotalStepNumber.GetValueOrDefault * 100 + StepProgressValue) control.Visible = True control.GroupBox.Text = taskItem.TaskTitle @@ -156,21 +156,21 @@ Public Class MultiTaskProgessForm Case ProgressingTaskItem.ProgressingTaskStatus.NotStarted control.LabelStepInfo.Text = "Noch nicht gestartet, insgesamt " & taskItem.TotalStepsCount & " Schritte" If taskItem.EstimatedTimeOfArrival.HasValue Then - control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss") & "" + control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & "" End If SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressInformation) Case ProgressingTaskItem.ProgressingTaskStatus.InProgress control.LabelStepInfo.Text = "In Bearbeitung: Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle & StepProgressValueText SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressInformation) If taskItem.EstimatedTimeOfArrival.HasValue Then - control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss") & "" + control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & "" End If Case ProgressingTaskItem.ProgressingTaskStatus.FailingInCriticalState control.LabelStepInfo.Text = "Fehlschlag erkannt, aktuell in Bearbeitung: Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle & StepProgressValueText SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressErrors) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Red If taskItem.EstimatedTimeOfArrival.HasValue Then - control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss") & "" + control.LabelStepInfo.Text &= System.Environment.NewLine & "ETA: " & taskItem.EstimatedTimeOfArrival.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & "" End If Case ProgressingTaskItem.ProgressingTaskStatus.FailingWithRollbackOption control.LabelStepInfo.Text = "Fehlschlag erkannt, aktuell in Bearbeitung: Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle & StepProgressValueText @@ -181,17 +181,17 @@ Public Class MultiTaskProgessForm SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressErrors) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Yellow Case ProgressingTaskItem.ProgressingTaskStatus.Completed - control.LabelStepInfo.Text = "Erfolgreich abgeschlossen in " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss") & " (d.hh:min:sec)" + control.LabelStepInfo.Text = "Erfolgreich abgeschlossen in " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & " (d.hh:min:sec)" SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressInformation) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Green Case ProgressingTaskItem.ProgressingTaskStatus.FailedWithRollbackOption - control.LabelStepInfo.Text = "Fehlgeschlagen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss") & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle + control.LabelStepInfo.Text = "Fehlgeschlagen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressErrors) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Yellow control.ProgressBar.Value = control.ProgressBar.Maximum 'stops the animation effect control.ProgressBar.Value = NewProgressValue Case ProgressingTaskItem.ProgressingTaskStatus.FailedInCriticalState - control.LabelStepInfo.Text = "Fehlgeschlagen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss") & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle + control.LabelStepInfo.Text = "Fehlgeschlagen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressErrors) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Red control.ProgressBar.Value = control.ProgressBar.Maximum 'stops the animation effect @@ -200,7 +200,7 @@ Public Class MultiTaskProgessForm control.LabelStepInfo.Text = "Übersprungen" SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressInformation) Case ProgressingTaskItem.ProgressingTaskStatus.Aborted - control.LabelStepInfo.Text = "Abgebrochen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss") & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle + control.LabelStepInfo.Text = "Abgebrochen nach " & taskItem.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture) & " (d.hh:min:sec): Schritt " & taskItem.RunningTotalStepNumber.Value & "/" & taskItem.TotalStepsCount & ": " & taskItem.RunningStep.StepTitle SetToolTipForTaskControl(control, taskItem.SummaryText, TaskResultToolTipType.ProgressErrors) CType(control, ProgressingTaskControl).GroupBox.BackColor = Color.Yellow control.ProgressBar.Value = control.ProgressBar.Maximum 'stops the animation effect diff --git a/CompuMaster.TaskManagement/Exceptions/StepException.vb b/CompuMaster.TaskManagement/Exceptions/StepException.vb new file mode 100644 index 0000000..04dc068 --- /dev/null +++ b/CompuMaster.TaskManagement/Exceptions/StepException.vb @@ -0,0 +1,21 @@ +Namespace Exceptions + +#Disable Warning CA2237 ' Mark ISerializable types with serializable +#Disable Warning CA1032 ' Implement standard exception constructors + Public Class StepException + +#Enable Warning CA1032 ' Implement standard exception constructors +#Enable Warning CA2237 ' Mark ISerializable types with serializable + Inherits System.Exception + + Public Sub New(message As String) + MyBase.New(message) + End Sub + + Public Sub New(message As String, innerException As Exception) + MyBase.New(message, innerException) + End Sub + + End Class + +End Namespace \ No newline at end of file diff --git a/CompuMaster.TaskManagement/UserAbortedMessageException.vb b/CompuMaster.TaskManagement/Exceptions/UserAbortedMessageException.vb similarity index 100% rename from CompuMaster.TaskManagement/UserAbortedMessageException.vb rename to CompuMaster.TaskManagement/Exceptions/UserAbortedMessageException.vb diff --git a/CompuMaster.TaskManagement/ProgressingTaskBundle.vb b/CompuMaster.TaskManagement/ProgressingTaskBundle.vb index 7981da0..8598d39 100644 --- a/CompuMaster.TaskManagement/ProgressingTaskBundle.vb +++ b/CompuMaster.TaskManagement/ProgressingTaskBundle.vb @@ -96,7 +96,7 @@ Public Class ProgressingTaskBundle Private Async Function RunAllTasksAsync(cancellationToken As Threading.CancellationToken) As Task ' Überprüfung auf doppelte Instanzen (Objektidentität) Dim duplicates = Tasks.GroupBy(Function(t) t).Where(Function(g) g.Count() > 1).Select(Function(g) g.Key).ToList() - If duplicates.Any() Then + If duplicates.Count <> 0 Then Throw New InvalidOperationException("Doppelte Instanzen von ProgressingTaskItem in der Aufgabenliste gefunden.") End If diff --git a/CompuMaster.TaskManagement/ProgressingTaskItem.vb b/CompuMaster.TaskManagement/ProgressingTaskItem.vb index 69cf4eb..a050494 100644 --- a/CompuMaster.TaskManagement/ProgressingTaskItem.vb +++ b/CompuMaster.TaskManagement/ProgressingTaskItem.vb @@ -3,6 +3,7 @@ Option Strict On Imports System.Threading Imports CompuMaster.TaskManagement.ProgressingTaskStepBase +Imports CompuMaster.TaskManagement.Exceptions Public Class ProgressingTaskItem @@ -44,11 +45,11 @@ Public Class ProgressingTaskItem ''' ''' Must always run (for e.g. rollback tasks), even if previous tasks failed or were cancelled ''' - RunAlways + RunAlways = 0 ''' ''' Run only if previous tasks completed successfully and no cancellation was requested, otherweise skip ''' - SkipIfPreviousTasksFailedOrCancelled + SkipIfPreviousTasksFailedOrCancelled = 1 End Enum ''' @@ -178,7 +179,7 @@ Public Class ProgressingTaskItem ''' Public Function TotalStepItem(totalStepIndex As Integer) As ProgressingTaskStepBase If totalStepIndex < 0 OrElse totalStepIndex >= TotalStepsCount Then - Throw New ArgumentOutOfRangeException(NameOf(totalStepIndex), "Argument totalStepIndex=" & totalStepIndex.ToString & ", but allowed range=0.." & TotalStepsCount - 1) + Throw New ArgumentOutOfRangeException(NameOf(totalStepIndex), "Argument totalStepIndex=" & totalStepIndex.ToString(System.Globalization.CultureInfo.InvariantCulture) & ", but allowed range=0.." & TotalStepsCount - 1) End If If totalStepIndex < FirstStepsWhichCanBeRolledBack.Count Then Return FirstStepsWhichCanBeRolledBack(totalStepIndex) @@ -247,7 +248,7 @@ Public Class ProgressingTaskItem Next Catch ex As Exceptions.UserAbortedMessageException 'Log exception - LoggedExceptions.Add(New Exception("Step " & _RunningStepNumber.Value & " aborted: " & CurrentStep.StepTitle, ex)) + LoggedExceptions.Add(New StepException("Step " & _RunningStepNumber.Value & " aborted: " & CurrentStep.StepTitle, ex)) Status = ProgressingTaskItem.ProgressingTaskStatus.Aborting _EndTime = DateTime.Now @@ -255,7 +256,7 @@ Public Class ProgressingTaskItem CreateRollbackTaskItemAndAppendToTaskBundle() Catch ex As Exception 'Log exception - LoggedExceptions.Add(New Exception("Step " & _RunningStepNumber.Value & " failed: " & CurrentStep.StepTitle, ex)) + LoggedExceptions.Add(New StepException("Step " & _RunningStepNumber.Value & " failed: " & CurrentStep.StepTitle, ex)) Status = ProgressingTaskItem.ProgressingTaskStatus.FailingWithRollbackOption _EndTime = DateTime.Now @@ -429,9 +430,9 @@ Public Class ProgressingTaskItem Public Function ConsumedTimeStatisticsInfo(Optional fullLength As Boolean = False) As String Dim Result As New Text.StringBuilder Result.AppendLine("Consumed time statistics for task:") - If Me.EstimatedTimeToRun.HasValue Then Result.AppendLine("* Estimated time: " & Me.EstimatedTimeToRun.Value.ToString("d\.hh\:mm\:ss")) + If Me.EstimatedTimeToRun.HasValue Then Result.AppendLine("* Estimated time: " & Me.EstimatedTimeToRun.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture)) 'Show consumed time statistics for each step if full length is requested or if there are less than 40 steps - If Me.ConsumedTime.HasValue Then Result.AppendLine("* Consumed time: " & Me.ConsumedTime.Value.ToString("d\.hh\:mm\:ss")) + If Me.ConsumedTime.HasValue Then Result.AppendLine("* Consumed time: " & Me.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture)) If Not Me.EstimatedTimeToRun.HasValue AndAlso Not Me.ConsumedTime.HasValue Then Result.AppendLine("* No time information available") Dim StartIndex As Integer @@ -449,8 +450,8 @@ Public Class ProgressingTaskItem Dim CurrentStep As ProgressingTaskStepBase = Me.TotalStepItem(MyCounter) Result.AppendLine() Result.AppendLine("Step " & MyCounter + 1 & ": " & CurrentStep.StepTitle) - If CurrentStep.EstimatedTimeToRun.HasValue Then Result.AppendLine("* Estimated time: " & CurrentStep.EstimatedTimeToRun.Value.ToString("d\.hh\:mm\:ss")) - If CurrentStep.ConsumedTime.HasValue Then Result.AppendLine("* Consumed time: " & CurrentStep.ConsumedTime.Value.ToString("d\.hh\:mm\:ss")) + If CurrentStep.EstimatedTimeToRun.HasValue Then Result.AppendLine("* Estimated time: " & CurrentStep.EstimatedTimeToRun.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture)) + If CurrentStep.ConsumedTime.HasValue Then Result.AppendLine("* Consumed time: " & CurrentStep.ConsumedTime.Value.ToString("d\.hh\:mm\:ss", System.Globalization.CultureInfo.InvariantCulture)) If Not CurrentStep.EstimatedTimeToRun.HasValue AndAlso Not CurrentStep.ConsumedTime.HasValue Then Result.AppendLine("* No time information available") Next Return Result.ToString @@ -517,7 +518,7 @@ Public Class ProgressingTaskItem ''' Erstellen eines StackTrace ohne die letzte Methode ''' ''' - Private Function GetStackTraceWithoutLastMethod() As String + Private Shared Function GetStackTraceWithoutLastMethod() As String ' Holen Sie sich den vollständigen StackTrace Dim fullStackTrace As String = Environment.StackTrace diff --git a/CompuMaster.TaskManagement/ProgressingTaskStepBase.vb b/CompuMaster.TaskManagement/ProgressingTaskStepBase.vb index 5f7086b..1d4da4c 100644 --- a/CompuMaster.TaskManagement/ProgressingTaskStepBase.vb +++ b/CompuMaster.TaskManagement/ProgressingTaskStepBase.vb @@ -1,4 +1,5 @@ Imports CompuMaster.TaskManagement.ProgressingTaskBundle +Imports CompuMaster.TaskManagement.Exceptions Public MustInherit Class ProgressingTaskStepBase @@ -51,7 +52,7 @@ Public MustInherit Class ProgressingTaskStepBase Me.Status = ProgressingTaskStepStatus.Failed _EndTime = DateTime.Now Me.FoundException = ex - Throw New Exception("Fehlgeschlagener Einzelschritt: " & StepTitle, ex) + Throw New StepException("Fehlgeschlagener Einzelschritt: " & StepTitle, ex) End Try Case ProgressingTaskStepStatus.InProgress Throw New InvalidOperationException("This step is already in progress") @@ -89,7 +90,7 @@ Public MustInherit Class ProgressingTaskStepBase Failed = 3 End Enum - Public Status As ProgressingTaskStepStatus = ProgressingTaskStepStatus.NotStarted + Public Property Status As ProgressingTaskStepStatus = ProgressingTaskStepStatus.NotStarted Public Enum ProgressingTaskStepFailAction ''' @@ -126,7 +127,7 @@ Public MustInherit Class ProgressingTaskStepBase CollectedWarnings.Add(New ValueTuple(Of String, String)(warning, stacktrace)) End Sub - Private Function GetStackTraceWithoutLastMethod() As String + Private Shared Function GetStackTraceWithoutLastMethod() As String ' Holen Sie sich den vollständigen StackTrace Dim fullStackTrace As String = Environment.StackTrace diff --git a/CompuMaster.TaskManagement/Tools.vb b/CompuMaster.TaskManagement/Tools.vb index 00b763f..35c0af9 100644 --- a/CompuMaster.TaskManagement/Tools.vb +++ b/CompuMaster.TaskManagement/Tools.vb @@ -45,7 +45,7 @@ Friend NotInheritable Class Tools ElseIf spaceCountForIndentation > 0 Then 'Add indentation Return CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation) & text.Replace(ControlChars.CrLf, ControlChars.CrLf & CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation)) Else 'Remove indentation - If text.StartsWith(CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation)) Then + If text.StartsWith(CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation), False, System.Globalization.CultureInfo.InvariantCulture) Then 'remove indentation at begin of text Return text.Substring(spaceCountForIndentation).Replace(ControlChars.CrLf & CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation), ControlChars.CrLf) Else @@ -68,7 +68,7 @@ Friend NotInheritable Class Tools ElseIf spaceCountForIndentation > 0 Then 'Add indentation Return CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation) & text.Replace(lineBreak, lineBreak & CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation)) Else 'Remove indentation - If text.StartsWith(CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation)) Then + If text.StartsWith(CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation), False, System.Globalization.CultureInfo.InvariantCulture) Then 'remove indentation at begin of text Return text.Substring(spaceCountForIndentation).Replace(lineBreak & CompuMaster.VisualBasicCompatibility.Strings.Space(spaceCountForIndentation), lineBreak) Else @@ -117,9 +117,9 @@ Friend NotInheritable Class Tools Public Shared Function PathCombine(absolutePath As String, relativePath As String) As String absolutePath = ConvertPathWithDirectorySeparatorsForCurrentPlatform(absolutePath) relativePath = ConvertPathWithDirectorySeparatorsForCurrentPlatform(relativePath) - If relativePath.StartsWith("." & System.IO.Path.DirectorySeparatorChar) Then + If relativePath.StartsWith("." & System.IO.Path.DirectorySeparatorChar, False, System.Globalization.CultureInfo.InvariantCulture) Then Return PathCombine(absolutePath, relativePath.Substring(2)) - ElseIf relativePath.StartsWith(".." & System.IO.Path.DirectorySeparatorChar) Then + ElseIf relativePath.StartsWith(".." & System.IO.Path.DirectorySeparatorChar, False, System.Globalization.CultureInfo.InvariantCulture) Then Return PathCombine(System.IO.Path.GetDirectoryName(absolutePath), relativePath.Substring(3)) Else Return System.IO.Path.Combine(absolutePath, relativePath) @@ -172,13 +172,13 @@ Friend NotInheritable Class Tools Return Nothing ElseIf basePathForRelativePath = Nothing Then Return absolutePath - ElseIf basePathForRelativePath.EndsWith(System.IO.Path.DirectorySeparatorChar) AndAlso absolutePath.StartsWith(basePathForRelativePath) Then + ElseIf basePathForRelativePath.EndsWith(System.IO.Path.DirectorySeparatorChar, False, System.Globalization.CultureInfo.InvariantCulture) AndAlso absolutePath.StartsWith(basePathForRelativePath, False, System.Globalization.CultureInfo.InvariantCulture) Then Dim ParentPathChain As String = "" For MyCounter As Integer = 1 To parentLevel ParentPathChain &= ".." & System.IO.Path.DirectorySeparatorChar Next Return ParentPathChain & absolutePath.Replace(basePathForRelativePath, "") - ElseIf absolutePath.StartsWith(basePathForRelativePath & System.IO.Path.DirectorySeparatorChar) Then + ElseIf absolutePath.StartsWith(basePathForRelativePath & System.IO.Path.DirectorySeparatorChar, False, System.Globalization.CultureInfo.InvariantCulture) Then Dim ParentPathChain As String = "" For MyCounter As Integer = 1 To parentLevel ParentPathChain &= ".." & System.IO.Path.DirectorySeparatorChar @@ -302,7 +302,7 @@ Friend NotInheritable Class Tools If value = Nothing Then Return alternativeChoice Else - Return value.ToString + Return value.ToString(System.Globalization.CultureInfo.InvariantCulture) End If End Function @@ -407,7 +407,7 @@ Friend NotInheritable Class Tools ''' Public Shared Function ReplaceAtEndOfString(text As String, searchValue As String, replacement As String) As String If text = Nothing OrElse searchValue = Nothing OrElse text.Length < searchValue.Length Then Return text - If text.EndsWith(searchValue) Then + If text.EndsWith(searchValue, False, System.Globalization.CultureInfo.InvariantCulture) Then Return text.Substring(0, text.Length - searchValue.Length) & replacement Else Return text diff --git a/README.md b/README.md index 7b7fadb..74e3699 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,9 @@ Run (long-running) Tasks and optionally visualize them * FirstStepsWhichCanBeRolledBack * SecondStepsWithoutRollbackOption * RollbackSteps - * will run only if previous task items completed without critical failures + * will run + * only if previous task items completed without critical failures + * or always * Task bundles * might run * successfull,