MS FlowSearch und Ansatz DocumentResultlist

This commit is contained in:
2021-02-02 11:06:42 +01:00
parent 15653490b1
commit de685806f0
20 changed files with 635 additions and 156 deletions

View File

@@ -84,7 +84,7 @@ Partial Class frmDocumentResultList
Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1, Me.RepositoryItemTextEdit2})
Me.RibbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl.Size = New System.Drawing.Size(1189, 158)
Me.RibbonControl.Size = New System.Drawing.Size(1189, 159)
Me.RibbonControl.StatusBar = Me.RibbonStatusBar
'
'SwitchMainContainerHorizontal
@@ -107,6 +107,7 @@ Partial Class frmDocumentResultList
Me.BarButtonItemExportGrid1.Id = 3
Me.BarButtonItemExportGrid1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItemExportGrid1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItemExportGrid1.Name = "BarButtonItemExportGrid1"
Me.BarButtonItemExportGrid1.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing
'
'BarButtonItem1
'
@@ -159,6 +160,7 @@ Partial Class frmDocumentResultList
Me.BarButtonItem5.Id = 10
Me.BarButtonItem5.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem5.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem5.Name = "BarButtonItem5"
Me.BarButtonItem5.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing
'
'BarEditItem1
'
@@ -206,6 +208,7 @@ Partial Class frmDocumentResultList
Me.labelWarning.ItemAppearance.Normal.BackColor = System.Drawing.Color.White
Me.labelWarning.ItemAppearance.Normal.Options.UseBackColor = True
Me.labelWarning.Name = "labelWarning"
Me.labelWarning.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph
Me.labelWarning.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing
'
'RibbonPage1
@@ -242,10 +245,10 @@ Partial Class frmDocumentResultList
Me.RibbonStatusBar.ItemLinks.Add(Me.labelResultCount)
Me.RibbonStatusBar.ItemLinks.Add(Me.labelCriticalError)
Me.RibbonStatusBar.ItemLinks.Add(Me.labelWarning)
Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 647)
Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 649)
Me.RibbonStatusBar.Name = "RibbonStatusBar"
Me.RibbonStatusBar.Ribbon = Me.RibbonControl
Me.RibbonStatusBar.Size = New System.Drawing.Size(1189, 24)
Me.RibbonStatusBar.Size = New System.Drawing.Size(1189, 22)
'
'SplitContainerControl1
'
@@ -257,7 +260,7 @@ Partial Class frmDocumentResultList
Me.SplitContainerControl1.Panel1.Text = "Panel1"
Me.SplitContainerControl1.Panel2.Controls.Add(Me.SplitContainerControl2)
Me.SplitContainerControl1.Panel2.Text = "Panel2"
Me.SplitContainerControl1.Size = New System.Drawing.Size(762, 489)
Me.SplitContainerControl1.Size = New System.Drawing.Size(762, 490)
Me.SplitContainerControl1.SplitterPosition = 382
Me.SplitContainerControl1.TabIndex = 2
Me.SplitContainerControl1.Text = "SplitContainerControl1"
@@ -269,13 +272,13 @@ Partial Class frmDocumentResultList
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.MenuManager = Me.RibbonControl
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(382, 489)
Me.GridControl1.Size = New System.Drawing.Size(382, 490)
Me.GridControl1.TabIndex = 0
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
'GridView1
'
Me.GridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.WhiteSmoke
Me.GridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.Gainsboro
Me.GridView1.Appearance.EvenRow.Options.UseBackColor = True
Me.GridView1.Appearance.FocusedRow.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.GridView1.Appearance.FocusedRow.Options.UseBackColor = True
@@ -309,7 +312,7 @@ Partial Class frmDocumentResultList
Me.SplitContainerControl2.Panel1.Text = "Panel1"
Me.SplitContainerControl2.Panel2.Controls.Add(Me.GridControl3)
Me.SplitContainerControl2.Panel2.Text = "Panel2"
Me.SplitContainerControl2.Size = New System.Drawing.Size(370, 489)
Me.SplitContainerControl2.Size = New System.Drawing.Size(370, 490)
Me.SplitContainerControl2.SplitterPosition = 223
Me.SplitContainerControl2.TabIndex = 0
Me.SplitContainerControl2.Text = "SplitContainerControl2"
@@ -327,7 +330,7 @@ Partial Class frmDocumentResultList
'
'GridView2
'
Me.GridView2.Appearance.EvenRow.BackColor = System.Drawing.Color.WhiteSmoke
Me.GridView2.Appearance.EvenRow.BackColor = System.Drawing.Color.Gainsboro
Me.GridView2.Appearance.EvenRow.Options.UseBackColor = True
Me.GridView2.Bands.AddRange(New DevExpress.XtraGrid.Views.BandedGrid.GridBand() {Me.GridBand2})
Me.GridView2.GridControl = Me.GridControl2
@@ -354,13 +357,13 @@ Partial Class frmDocumentResultList
Me.GridControl3.MainView = Me.GridView3
Me.GridControl3.MenuManager = Me.RibbonControl
Me.GridControl3.Name = "GridControl3"
Me.GridControl3.Size = New System.Drawing.Size(370, 256)
Me.GridControl3.Size = New System.Drawing.Size(370, 257)
Me.GridControl3.TabIndex = 0
Me.GridControl3.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView3})
'
'GridView3
'
Me.GridView3.Appearance.EvenRow.BackColor = System.Drawing.Color.WhiteSmoke
Me.GridView3.Appearance.EvenRow.BackColor = System.Drawing.Color.Gainsboro
Me.GridView3.Appearance.EvenRow.Options.UseBackColor = True
Me.GridView3.Bands.AddRange(New DevExpress.XtraGrid.Views.BandedGrid.GridBand() {Me.GridBand3})
Me.GridView3.GridControl = Me.GridControl3
@@ -383,13 +386,13 @@ Partial Class frmDocumentResultList
'SplitContainerControl3
'
Me.SplitContainerControl3.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl3.Location = New System.Drawing.Point(0, 158)
Me.SplitContainerControl3.Location = New System.Drawing.Point(0, 159)
Me.SplitContainerControl3.Name = "SplitContainerControl3"
Me.SplitContainerControl3.Panel1.Controls.Add(Me.SplitContainerControl1)
Me.SplitContainerControl3.Panel1.Text = "Panel1"
Me.SplitContainerControl3.Panel2.Controls.Add(Me.DocumentViewer1)
Me.SplitContainerControl3.Panel2.Text = "Panel2"
Me.SplitContainerControl3.Size = New System.Drawing.Size(1189, 489)
Me.SplitContainerControl3.Size = New System.Drawing.Size(1189, 490)
Me.SplitContainerControl3.SplitterPosition = 762
Me.SplitContainerControl3.TabIndex = 5
Me.SplitContainerControl3.Text = "SplitContainerControl3"
@@ -400,7 +403,7 @@ Partial Class frmDocumentResultList
Me.DocumentViewer1.FileLoaded = False
Me.DocumentViewer1.Location = New System.Drawing.Point(0, 0)
Me.DocumentViewer1.Name = "DocumentViewer1"
Me.DocumentViewer1.Size = New System.Drawing.Size(417, 489)
Me.DocumentViewer1.Size = New System.Drawing.Size(417, 490)
Me.DocumentViewer1.TabIndex = 0
'
'XtraSaveFileDialog
@@ -417,6 +420,7 @@ Partial Class frmDocumentResultList
Me.Controls.Add(Me.RibbonStatusBar)
Me.Controls.Add(Me.RibbonControl)
Me.IconOptions.Icon = CType(resources.GetObject("frmDocumentResultList.IconOptions.Icon"), System.Drawing.Icon)
Me.IconOptions.Image = Global.DigitalData.GUIs.Common.My.Resources.Resources.zoom_less
Me.IconOptions.ShowIcon = False
Me.Name = "frmDocumentResultList"
Me.Ribbon = Me.RibbonControl

View File

@@ -15,6 +15,8 @@ Imports DigitalData.Modules.EDMI.API.Client
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.BandedGrid
Imports System.ComponentModel
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DevExpress.XtraEditors.ViewInfo
Public Class frmDocumentResultList
Implements IResultForm
@@ -220,15 +222,18 @@ Public Class frmDocumentResultList
Case 0
Dim oResult As DocumentResult = _ResultLists.Item(0)
CreateDocumentGrid(GridView1, oResult)
RestoreLayout(GridView1)
UpdateGridHeader(_ResultLists, index, oResult.Datatable.Rows.Count)
Case 1
Dim oResult As DocumentResult = _ResultLists.Item(1)
CreateDocumentGrid(GridView2, oResult)
RestoreLayout(GridView1)
UpdateGridHeader(_ResultLists, index, oResult.Datatable.Rows.Count)
Case 2
Dim oResult As DocumentResult = _ResultLists.Item(2)
CreateDocumentGrid(GridView3, oResult)
RestoreLayout(GridView1)
UpdateGridHeader(_ResultLists, index, oResult.Datatable.Rows.Count)
Case Else
@@ -425,7 +430,26 @@ Public Class frmDocumentResultList
_Logger.Error(ex)
End Try
End Sub
Private Sub GridView1_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
Dim view As GridView = TryCast(sender, GridView)
If e.Column.FieldName = "Name" Then
Dim cellInfo As GridCellInfo = TryCast(e.Cell, GridCellInfo)
Dim info As TextEditViewInfo = TryCast(cellInfo.ViewInfo, TextEditViewInfo)
If info IsNot Nothing Then
If OperationMode = IResultForm.Mode.NoAppServer Then
' oNewRow.Item(COLUMN_ICON) = _Helpers.GetIconByExtension(oFullpath)
' oNewRow.Item(COLUMN_FILEPATH) = oFullpath
' oNewRow.Item(COLUMN_FILENAME) = oFilename
Else
'info.ContextImage = _Helpers.GetIconByExtension(oFilename)
' oNewRow.Item(COLUMN_ICON) = _Helpers.GetIconByExtension(oFilename)
' oNewRow.Item(COLUMN_FILEPATH) = String.Empty
' oNewRow.Item(COLUMN_FILENAME) = oFilename
End If
info.CalcViewInfo()
End If
End If
End Sub
Private Function TryGetItem(DataRow As DataRow, ColumnName As String, Optional DefaultValue As String = "") As String
Try
Return DataRow.Item(ColumnName)
@@ -499,7 +523,10 @@ Public Class frmDocumentResultList
Return Nothing
End If
End Function
Private Function GetDevexpressGrid_LayoutName(pGridView As GridView)
Dim Filename As String = $"DevExpressGridViewDocResult_{pGridView.Name}UserLayout.xml"
Return System.IO.Path.Combine(_Config.UserConfigPath.Replace("UserConfig.xml", ""), Filename)
End Function
Private Function GetActiveGridControl() As GridControl
If _ActiveGrid Is Nothing Then
Return Nothing
@@ -508,10 +535,30 @@ Public Class frmDocumentResultList
Return _ActiveGrid
End Function
Private Sub GridViewSave_Layout(pGridView As GridView)
Try
Dim oXml As String = GetDevexpressGrid_LayoutName(pGridView)
pGridView.SaveLayoutToXml(oXml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
_Logger.Error(ex)
_Logger.Info("Error while saving GridLayout: " & ex.Message)
End Try
End Sub
Private Sub RestoreLayout(pGridView As GridView)
Try
Dim oXml As String = GetDevexpressGrid_LayoutName(pGridView)
pGridView.RestoreLayoutFromXml(oXml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
_Logger.Error(ex)
_Logger.Info("Error while restoring layout: " & ex.Message)
End Try
End Sub
Private Sub GridControl_Enter(sender As GridControl, e As EventArgs) Handles GridControl1.Enter, GridControl2.Enter, GridControl3.Enter
_ActiveGrid = sender
BarButtonItem5.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
BarButtonItemExportGrid1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
SetActiveGridBand()
End Sub
@@ -665,4 +712,26 @@ Public Class frmDocumentResultList
labelCriticalError.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
labelWarning.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End Sub
Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem5.ItemClick
If Not IsNothing(_ActiveGrid) Then
Try
Dim oFile = GetDevexpressGrid_LayoutName(_ActiveGrid.MainView)
If File.Exists(oFile) Then
File.Delete(oFile)
UpdateGridData()
End If
Catch ex As Exception
End Try
End If
End Sub
Private Sub frmDocumentResultList_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
GridViewSave_Layout(_ActiveGrid.MainView)
End Sub
End Class