ZooFlow: clean up classes, use base class
This commit is contained in:
parent
0bc57ca2bb
commit
1b11cde174
@ -7,6 +7,8 @@ Imports DigitalData.Modules.Logging
|
||||
''' Example: --start-search=id#7~doctype#ARE
|
||||
''' </summary>
|
||||
Public Class ClassCommandlineArgs
|
||||
Inherits Base.BaseClass
|
||||
|
||||
Private CommandLineArgTypes As New List(Of String) From {
|
||||
"show-profile",
|
||||
"start-search"
|
||||
@ -18,12 +20,8 @@ Public Class ClassCommandlineArgs
|
||||
Public FunctionName As String
|
||||
Public FunctionArgs As New Dictionary(Of String, String)
|
||||
|
||||
Private LogConfig As LogConfig
|
||||
Private Logger As Logger
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
LogConfig = pLogConfig
|
||||
Logger = LogConfig.GetLogger()
|
||||
MyBase.New(pLogConfig)
|
||||
End Sub
|
||||
|
||||
Public Sub Parse(Args As List(Of String))
|
||||
|
||||
@ -4,19 +4,21 @@ Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ClassDragDrop
|
||||
Inherits Base.BaseClass
|
||||
|
||||
Private downHitInfo As GridHitInfo = Nothing
|
||||
Private _Logger As Logger
|
||||
Public Sub New()
|
||||
_Logger = My.LogConfig.GetLogger
|
||||
Public Sub New(LogConfig As LogConfig)
|
||||
MyBase.New(LogConfig)
|
||||
End Sub
|
||||
|
||||
Public Sub AddGridView(view As GridView)
|
||||
AddHandler view.MouseDown, AddressOf view_MouseDown
|
||||
AddHandler view.MouseMove, AddressOf view_MouseMove
|
||||
AddHandler view.GridControl.DragOver, AddressOf grid_DragOver
|
||||
AddHandler view.MouseDown, AddressOf View_MouseDown
|
||||
AddHandler view.MouseMove, AddressOf View_MouseMove
|
||||
AddHandler view.GridControl.DragOver, AddressOf GridControl_DragOver
|
||||
End Sub
|
||||
|
||||
Private Sub view_MouseDown(sender As Object, e As MouseEventArgs)
|
||||
Private Sub View_MouseDown(sender As Object, e As MouseEventArgs)
|
||||
Dim view As GridView = sender
|
||||
downHitInfo = Nothing
|
||||
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
||||
@ -30,7 +32,7 @@ Public Class ClassDragDrop
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub view_MouseMove(sender As Object, e As MouseEventArgs)
|
||||
Private Sub View_MouseMove(sender As Object, e As MouseEventArgs)
|
||||
Try
|
||||
Dim view As GridView = sender
|
||||
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
||||
@ -67,18 +69,18 @@ Public Class ClassDragDrop
|
||||
|
||||
DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = True
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
MsgBox("Error in view_MouseMove: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub grid_DragOver(sender As Object, e As DragEventArgs)
|
||||
Private Sub GridControl_DragOver(sender As Object, e As DragEventArgs)
|
||||
If e.Data.GetDataPresent(DataFormats.Text) Then
|
||||
Dim data As String = e.Data.GetData(DataFormats.Text)
|
||||
Dim source = data.Split("|")(1)
|
||||
|
||||
@ -14,9 +14,9 @@ Imports DigitalData.GUIs.ZooFlow.ClassInitLoader
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
|
||||
Public Class ClassInit
|
||||
Inherits Base.BaseClass
|
||||
|
||||
Private ReadOnly _MainForm As frmFlowForm
|
||||
Private ReadOnly _Logger As Logger
|
||||
Private ReadOnly _LogConfig As LogConfig
|
||||
Private ReadOnly _DataASorDB As ClassDataASorDB
|
||||
Private ReadOnly _Database As DatabaseWithFallback
|
||||
Private _Loader As ClassInitLoader
|
||||
@ -24,9 +24,8 @@ Public Class ClassInit
|
||||
Public Event Completed As EventHandler
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm)
|
||||
MyBase.New(LogConfig)
|
||||
_MainForm = ParentForm
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
|
||||
'TODO: Remove when Globix uses DatabaseWithFallback
|
||||
clsDataASorDB = New ClassDataASorDB(LogConfig)
|
||||
@ -37,7 +36,7 @@ Public Class ClassInit
|
||||
MsgBox("Keine Verbindungs-Informationen hinterlegt. Anwendung wird beendet.", MsgBoxStyle.Critical, _MainForm.Text)
|
||||
Application.Exit()
|
||||
Else
|
||||
_Loader = New ClassInitLoader()
|
||||
_Loader = New ClassInitLoader(LogConfig)
|
||||
|
||||
' === Init Schritte definieren
|
||||
_Loader.AddStep("Initializing Base", AddressOf InitializeBase, True)
|
||||
@ -68,7 +67,7 @@ Public Class ClassInit
|
||||
My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString)
|
||||
|
||||
If My.DatabaseECM.DBInitialized = False Then
|
||||
_Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||
Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||
Throw New InitException("Could not initialize ECM-Database!")
|
||||
|
||||
Else
|
||||
@ -76,12 +75,12 @@ Public Class ClassInit
|
||||
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl)
|
||||
|
||||
If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then
|
||||
_Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!")
|
||||
Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!")
|
||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
End If
|
||||
|
||||
If oDatatable.Rows.Count > 1 Then
|
||||
_Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
||||
Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
End If
|
||||
|
||||
@ -96,7 +95,7 @@ Public Class ClassInit
|
||||
End If
|
||||
|
||||
If My.DatabaseIDB.DBInitialized = False Then
|
||||
_Logger.Warn("Could not initialize IDB-Database!")
|
||||
Logger.Warn("Could not initialize IDB-Database!")
|
||||
Throw New InitException("Could not initialize IDB-Database!")
|
||||
End If
|
||||
End Sub
|
||||
@ -105,7 +104,7 @@ Public Class ClassInit
|
||||
MyApplication.Service.Address = My.SystemConfig.AppServerConfig
|
||||
Dim oServerData = Client.ParseServiceAddress(My.SystemConfig.AppServerConfig)
|
||||
|
||||
My.Application.Service.Client = New Client(_LogConfig, oServerData.Item1, oServerData.Item2)
|
||||
My.Application.Service.Client = New Client(LogConfig, oServerData.Item1, oServerData.Item2)
|
||||
|
||||
If Not IsNothing(My.Application.Service.Client) Then
|
||||
If My.Application.Service.Client.Connect() Then
|
||||
@ -113,15 +112,15 @@ Public Class ClassInit
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Throw New InitException("Error in InitializeService", ex)
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub InitializeDatabaseWithFallback(MyApplication As My.MyApplication)
|
||||
Try
|
||||
My.Database = New DatabaseWithFallback(_LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
|
||||
My.Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Throw New InitException("Error InitializeDatabaseWithFallback!", ex)
|
||||
End Try
|
||||
End Sub
|
||||
@ -155,7 +154,7 @@ Public Class ClassInit
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Throw New InitException("Error while initializing user!", ex)
|
||||
End Try
|
||||
End Sub
|
||||
@ -182,7 +181,7 @@ Public Class ClassInit
|
||||
|
||||
MyApplication.Settings.GdPictureKey = NotNull(oRow.Item("LICENSE"), String.Empty)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Throw New InitException("Error Initialize3rdParty!", ex)
|
||||
End Try
|
||||
End Sub
|
||||
@ -202,7 +201,7 @@ Public Class ClassInit
|
||||
End Select
|
||||
Next
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Throw New InitException("Error in InitBasicData", ex)
|
||||
End Try
|
||||
End Sub
|
||||
@ -300,15 +299,15 @@ Public Class ClassInit
|
||||
|
||||
Case "RESULT"
|
||||
Dim oLines = oValue.ToString.Split("|"c)
|
||||
_Logger.Debug("Access Result for Module {0}", ModuleName)
|
||||
Logger.Debug("Access Result for Module {0}", ModuleName)
|
||||
For Each oLine In oLines
|
||||
_Logger.Debug(oLine.Trim)
|
||||
Logger.Debug(oLine.Trim)
|
||||
Next
|
||||
Case "WORKING_MODE"
|
||||
Dim oLines = oValue.ToString.Split("|"c)
|
||||
_Logger.Debug("WORKING_MODEs for Module {0}", ModuleName)
|
||||
Logger.Debug("WORKING_MODEs for Module {0}", ModuleName)
|
||||
For Each oLine In oLines
|
||||
_Logger.Debug(oLine.Trim)
|
||||
Logger.Debug(oLine.Trim)
|
||||
If oLine = "NO_BASICCONF" Then
|
||||
MyApplication.User.HideBasicConfig = True
|
||||
|
||||
@ -328,7 +327,7 @@ Public Class ClassInit
|
||||
MyApplication.Search.SelectInIntegerAttributeIds = ""
|
||||
End Try
|
||||
Else
|
||||
_Logger.Info($"Wrong WorkingMode: {oLine}")
|
||||
Logger.Info($"Wrong WorkingMode: {oLine}")
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -34,7 +34,7 @@ Public Class frmGlobix_Index
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Logger As Logger
|
||||
|
||||
Private clswindowLocation As ClassWindowLocation
|
||||
Private clswindowLocation As ClassWindowLayout
|
||||
Private clsPatterns As GlobixPatterns
|
||||
Private clsPostProcessing As GlobixPostprocessing
|
||||
Private _DataASorDB As ClassDataASorDB
|
||||
@ -66,7 +66,7 @@ Public Class frmGlobix_Index
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_LogConfig = LogConfig
|
||||
_DataASorDB = New ClassDataASorDB(LogConfig)
|
||||
clswindowLocation = New ClassWindowLocation(LogConfig)
|
||||
clswindowLocation = New ClassWindowLayout(LogConfig)
|
||||
clsPatterns = New GlobixPatterns(LogConfig)
|
||||
clsPostProcessing = New GlobixPostprocessing(LogConfig)
|
||||
_idbdata = New ClassIDBData(LogConfig)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user