Clean up
This commit is contained in:
@@ -22,8 +22,10 @@ Imports DevExpress.XtraTreeList
|
||||
|
||||
Public Class frmMonitor
|
||||
Public Property LogConfig As LogConfig
|
||||
Public Property Logger As Logger
|
||||
Public Property ConfigManager As ConfigManager(Of Config)
|
||||
Public Property Database As MSSQLServer
|
||||
Public Property FormHelper As FormHelper
|
||||
|
||||
Private ReadOnly SQLColumns As New List(Of String) From {"SELECT1", "SELECT2", "SELECT3", "SELECT4"}
|
||||
Private ReadOnly DocViewColumns As New List(Of String) From {"DOCVIEW1", "DOCVIEW2"}
|
||||
@@ -78,9 +80,9 @@ Public Class frmMonitor
|
||||
Private Sub frmStart_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Try
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "Monitor")
|
||||
Logger = LogConfig.GetLogger()
|
||||
ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath, Application.UserAppDataPath, Application.StartupPath)
|
||||
|
||||
InitializeBaseForm(LogConfig)
|
||||
FormHelper = New FormHelper(LogConfig, Me)
|
||||
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
Dim oSQLConfig As New frmSQLConfig(LogConfig)
|
||||
@@ -89,7 +91,7 @@ Public Class frmMonitor
|
||||
ConfigManager.Save()
|
||||
Application.Restart()
|
||||
Else
|
||||
ShowErrorMessage("No Database configured. Application will close!")
|
||||
FormHelper.ShowErrorMessage(New ApplicationException("No Database configured. Application will close!"), "Form Load")
|
||||
Application.Exit()
|
||||
|
||||
End If
|
||||
@@ -145,7 +147,7 @@ Public Class frmMonitor
|
||||
SplitContainerControl3.Collapsed = True
|
||||
SplitContainerControl2.Collapsed = True
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
FormHelper.ShowErrorMessage(ex, "frmStart_Load")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -193,14 +195,14 @@ Public Class frmMonitor
|
||||
For Each oNode As TreeListNode In TreeListResults.Nodes
|
||||
ExpandNodes(oNode, Function(n)
|
||||
Dim oObjectValue = n.GetValue(oStateColumn)
|
||||
Dim oValue As String = NotNull(oObjectValue, String.Empty)
|
||||
Dim oValue As String = NotNull(oObjectValue.ToString, String.Empty)
|
||||
Return oValue IsNot Nothing AndAlso (oValue = STATE_WARNING Or oValue = STATE_FAILURE)
|
||||
End Function)
|
||||
Next
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
FormHelper.ShowErrorMessage(ex, "LoadData")
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
@@ -212,7 +214,7 @@ Public Class frmMonitor
|
||||
cmbSearches.Properties.Items.Clear()
|
||||
cmbSearches.Properties.Items.AddRange(SearchLoader.Searches)
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
FormHelper.ShowErrorMessage(ex, "LoadSearches")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -411,7 +413,7 @@ Public Class frmMonitor
|
||||
End Try
|
||||
Next
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
FormHelper.ShowErrorMessage(ex, "TreeListResults_FocusedNodeChanged")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user