Version 0.5.0.0
This commit is contained in:
@@ -20,7 +20,7 @@ Imports DevExpress.XtraEditors.Controls
|
||||
Imports DigitalData.GUIs.Monitor.SearchLoader
|
||||
Imports DevExpress.XtraLayout
|
||||
Imports DevExpress.XtraTreeList
|
||||
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
|
||||
Public Class frmMonitor
|
||||
Public Property LogConfig As LogConfig
|
||||
@@ -30,6 +30,7 @@ Public Class frmMonitor
|
||||
Public Property FormHelper As FormHelper
|
||||
Public Property Patterns As Patterns2
|
||||
|
||||
Private ReadOnly ColumnMarkers As New List(Of String) From {"[HTML]", "[SQL]", "[FILENAME]"}
|
||||
Private ReadOnly SQLColumns As New List(Of String) From {"SELECT1", "SELECT2", "SELECT3", "SELECT4"}
|
||||
Private ReadOnly DocViewColumns As New List(Of String) From {"DOCVIEW1", "DOCVIEW2"}
|
||||
Private ReadOnly HtmlViewColumns As New List(Of String) From {"HTML1", "HTML2"}
|
||||
@@ -45,20 +46,25 @@ Public Class frmMonitor
|
||||
|
||||
Private SQLResultGrids As List(Of GridControl)
|
||||
Private SQLResultTabs As List(Of XtraTabPage)
|
||||
Private SQLResultGridIndex As Integer = 0
|
||||
Private ActiveSQLResultGrid As GridControl
|
||||
|
||||
Private FileResultViewers As List(Of DocumentViewer)
|
||||
Private FileResultTabs As List(Of XtraTabPage)
|
||||
Private FileResultViewerIndex As Integer = 0
|
||||
|
||||
Private HtmlResultViewers As List(Of RichEditControl)
|
||||
Private HtmlResultTabs As List(Of XtraTabPage)
|
||||
|
||||
|
||||
Private Const STATE_SUCCESS As String = "SUCCESS"
|
||||
Private Const STATE_FAILURE As String = "FAILURE"
|
||||
Private Const STATE_WARNING As String = "WARNING"
|
||||
Private Const STATE_WAITING As String = "WAITING"
|
||||
Private Const STATE_HIGHLIGHT As String = "HIGHLIGHT"
|
||||
|
||||
Private MarkedColumns As New List(Of GridColumn)
|
||||
|
||||
|
||||
Private Enum NodeImage
|
||||
[Default] = 0
|
||||
@@ -158,8 +164,8 @@ Public Class frmMonitor
|
||||
For Each oViewer As DocumentViewer In FileResultViewers
|
||||
oViewer.Init(LogConfig, oLicense)
|
||||
Next
|
||||
SplitContainerControl3.Collapsed = True
|
||||
SplitContainerControl2.Collapsed = True
|
||||
SplitContainerSQL.Collapsed = True
|
||||
SplitContainerFileHTML.Collapsed = True
|
||||
Catch ex As Exception
|
||||
FormHelper.ShowErrorMessage(ex, "frmStart_Load")
|
||||
End Try
|
||||
@@ -186,6 +192,9 @@ Public Class frmMonitor
|
||||
Dim oSearch As Search = cmbSearches.EditValue
|
||||
Dim oMissingParams = False
|
||||
|
||||
MarkedColumns.Clear()
|
||||
HideAllTabs()
|
||||
|
||||
With AdornerUIManager2.ValidationHintProperties
|
||||
.State = VisualEffects.ValidationHintState.Invalid
|
||||
.InvalidState.ShowBorder = True
|
||||
@@ -272,8 +281,22 @@ Public Class frmMonitor
|
||||
TreeListResults.Dock = DockStyle.None
|
||||
|
||||
GridControlResults.DataSource = oTable
|
||||
GridViewResults.PopulateColumns()
|
||||
|
||||
MarkedColumns = GridViewResults.Columns.AsEnumerable.
|
||||
Where(Function(column)
|
||||
Dim oCaption = column.FieldName.ToUpper.Trim
|
||||
Return ColumnMarkers.Any(Function(marker) oCaption.EndsWith(marker))
|
||||
End Function).ToList()
|
||||
|
||||
For Each oColumn In MarkedColumns
|
||||
oColumn.VisibleIndex = -1
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
GridViewResults.FocusInvalidRow()
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
FormHelper.ShowErrorMessage(ex, "LoadData")
|
||||
@@ -472,8 +495,8 @@ Public Class frmMonitor
|
||||
oTabPage.PageVisible = False
|
||||
Next
|
||||
|
||||
SplitContainerControl3.Collapsed = True
|
||||
SplitContainerControl2.Collapsed = True
|
||||
SplitContainerSQL.Collapsed = True
|
||||
SplitContainerFileHTML.Collapsed = True
|
||||
|
||||
For Each oSQLCommand As KeyValuePair(Of String, String) In oSQLCommands
|
||||
Try
|
||||
@@ -770,11 +793,11 @@ Public Class frmMonitor
|
||||
Next
|
||||
|
||||
If oShouldToggleSQL Then
|
||||
SplitContainerControl3.Collapsed = Not SplitContainerControl3.Collapsed
|
||||
SplitContainerSQL.Collapsed = Not SplitContainerSQL.Collapsed
|
||||
End If
|
||||
|
||||
If oShouldToggleFile Then
|
||||
SplitContainerControl2.Collapsed = Not SplitContainerControl2.Collapsed
|
||||
SplitContainerFileHTML.Collapsed = Not SplitContainerFileHTML.Collapsed
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
@@ -786,5 +809,85 @@ Public Class frmMonitor
|
||||
TreeListResults.DataSource = Nothing
|
||||
GridControlResults.DataSource = Nothing
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewResults_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewResults.FocusedRowChanged
|
||||
If GridViewResults.FocusedRowHandle < 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
HideAllTabs()
|
||||
|
||||
Try
|
||||
Dim oRow As DataRow = GridViewResults.GetDataRow(GridViewResults.FocusedRowHandle)
|
||||
Dim oHtmlResultViewerIndex As Integer = 0
|
||||
Dim oGridResultIndex As Integer = 0
|
||||
Dim oViewerResultIndex As Integer = 0
|
||||
|
||||
For Each oColumn As GridColumn In MarkedColumns
|
||||
|
||||
Dim oValue = oRow.ItemEx(oColumn.FieldName, String.Empty)
|
||||
|
||||
If oValue.Length > 0 Then
|
||||
|
||||
If oColumn.FieldName.EndsWith("[HTML]") Then
|
||||
|
||||
Dim oViewer As RichEditControl = HtmlResultViewers.Item(oHtmlResultViewerIndex)
|
||||
Dim oTitle = oColumn.FieldName.Replace("[HTML]", "").Trim()
|
||||
oHtmlResultViewerIndex += 1
|
||||
FillResultHtmlViewer(oViewer, oValue, oTitle)
|
||||
SplitContainerFileHTML.Collapsed = False
|
||||
|
||||
ElseIf oColumn.FieldName.EndsWith("[SQL]") Then
|
||||
|
||||
Dim oTable As DataTable = Database.GetDatatable(oValue)
|
||||
If oTable Is Nothing Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oGridControl As GridControl = SQLResultGrids.Item(oGridResultIndex)
|
||||
Dim oTitle = oColumn.FieldName.Replace("[SQL]", "").Trim()
|
||||
oGridResultIndex += 1
|
||||
FillResultGrid(oGridControl, oTable, oTitle)
|
||||
SplitContainerSQL.Collapsed = False
|
||||
|
||||
ElseIf oColumn.FieldName.EndsWith("[FILENAME]") Then
|
||||
|
||||
If oValue Is Nothing Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If Not IO.File.Exists(oValue) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oViewer As DocumentViewer = FileResultViewers.Item(oViewerResultIndex)
|
||||
Dim oTitle = oColumn.FieldName.Replace("[FILENAME]", "").Trim()
|
||||
|
||||
oViewerResultIndex += 1
|
||||
FillResultViewer(oViewer, oValue, oTitle)
|
||||
SplitContainerFileHTML.Collapsed = False
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub HideAllTabs()
|
||||
Dim oAllTabs = SQLResultTabs.
|
||||
Concat(FileResultTabs).
|
||||
Concat(HtmlResultTabs)
|
||||
For Each oTabPage In oAllTabs
|
||||
oTabPage.PageVisible = False
|
||||
Next
|
||||
|
||||
SplitContainerSQL.Collapsed = True
|
||||
SplitContainerFileHTML.Collapsed = True
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user