ZooFlow: clean up classes, use base class

This commit is contained in:
Jonathan Jenne
2021-10-26 11:45:10 +02:00
parent 0bc57ca2bb
commit 1b11cde174
5 changed files with 44 additions and 44 deletions

View File

@@ -3,16 +3,17 @@ Imports DigitalData.GUIs.ZooFlow.My
Imports DigitalData.Modules.Logging
Public Class ClassInitLoader
Inherits Base.BaseClass
Private _Worker As BackgroundWorker
Private _Logger As Logger
Private _CurrentStep As InitStep
Public Steps As New List(Of InitStep)
Public Event ProgressChanged As EventHandler(Of InitProgress)
Public Event InitCompleted As EventHandler(Of RunWorkerCompletedEventArgs)
Public Sub New()
_Logger = My.LogConfig.GetLogger()
Public Sub New(LogConfig As LogConfig)
MyBase.New(LogConfig)
End Sub
Public Sub AddStep(Name As String, Action As Action(Of Object), Optional Fatal As Boolean = False)
@@ -61,11 +62,11 @@ Public Class ClassInitLoader
My.Application.ClipboardWatcher = oMyApplication.ClipboardWatcher
Catch ex As Exception
_Logger.Error(ex)
_Logger.Warn("Init Step '{0}' failed!", oStep.Name)
Logger.Error(ex)
Logger.Warn("Init Step '{0}' failed!", oStep.Name)
If oStep.Fatal Then
_Logger.Warn("Fatal error in '{0}'. Init will be aborted!", oStep.Name)
Logger.Warn("Fatal error in '{0}'. Init will be aborted!", oStep.Name)
Throw ex
End If
End Try