Zooflow: Workspaces
This commit is contained in:
@@ -18,7 +18,7 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
Imports DigitalData.Modules.Base.IDB.FileStore
|
||||
Imports DigitalData.GUIs.Common.Base
|
||||
'Imports DigitalData.GUIs.Common.Base
|
||||
Imports DigitalData.GUIs.Common.DocumentResultList
|
||||
|
||||
Public Class frmDocumentResultList
|
||||
@@ -48,6 +48,7 @@ Public Class frmDocumentResultList
|
||||
Private ReadOnly Params As Params
|
||||
Private ReadOnly LayoutManager As Layout
|
||||
Private ReadOnly FormHelper As FormHelper
|
||||
Private ReadOnly Workspace As Workspace
|
||||
Private WithEvents Watcher As Watcher
|
||||
|
||||
' Runtime variables
|
||||
@@ -109,6 +110,7 @@ Public Class frmDocumentResultList
|
||||
GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
FileEx = New Modules.Windows.File(pLogConfig)
|
||||
LayoutManager = New Layout(pLogConfig, Config, New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
Workspace = New Workspace(pLogConfig, Config, WorkspaceManager1)
|
||||
|
||||
UserLanguage = Utils.NotNull(Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
End Sub
|
||||
@@ -156,16 +158,6 @@ Public Class frmDocumentResultList
|
||||
DocumentViewer1.Init(LogConfig, Environment.Settings.GdPictureKey)
|
||||
End If
|
||||
|
||||
'Load config
|
||||
LayoutManager.LoadWindowLocationAndSize(Me)
|
||||
LayoutManager.DockManager_RestoreLayout(DockManager1)
|
||||
LayoutManager.Workspace_Restore(WorkspaceManager1)
|
||||
|
||||
SplitContainerControl1.SplitterPosition = Config1.Config.SplitContainer1Distance
|
||||
SwitchMainContainerHorizontal.Checked = Config1.Config.SplitContainer1Horizontal
|
||||
SplitContainerControl2.SplitterPosition = Config1.Config.SplitContainer2Distance
|
||||
SwitchDetailContainerHorizontal.Checked = Config1.Config.SplitContainer2Horizontal
|
||||
|
||||
' Hide options relating to a filepath for zooflow
|
||||
If OperationMode = OperationMode.ZooFlow Then
|
||||
RibbonPageGroupFilesystem.Visible = False
|
||||
@@ -204,8 +196,6 @@ Public Class frmDocumentResultList
|
||||
panelContainerStatus.Visibility = Docking.DockVisibility.Hidden
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' Hide the complete Navigation Ribbon Group if desired
|
||||
RibbonPageGroup_Navigation.Visible = Params.ShowBackNavigation
|
||||
|
||||
@@ -214,6 +204,23 @@ Public Class frmDocumentResultList
|
||||
|
||||
GridBuilder.WithReadOnlyOptions()
|
||||
|
||||
' Force initialize, this is needed so that grid settings are loaded correctly from the workspace
|
||||
GridControl1.ForceInitialize()
|
||||
GridControl2.ForceInitialize()
|
||||
GridControl3.ForceInitialize()
|
||||
|
||||
'Load window settings
|
||||
LayoutManager.LoadWindowLocationAndSize(Me)
|
||||
|
||||
' Load the workspaces from file, maybe do this earlier and get the available workspaces through params
|
||||
Workspace.LoadWorkspaces()
|
||||
|
||||
' This loads the available workspaces into the ribbon
|
||||
Workspace.GetWorkspaceButtons(RibbonControl, RibbonPageGroupWorkspace)
|
||||
|
||||
' This loads the default workspace, for now
|
||||
Workspace.LoadWorkspace(Config.Config.SelectedWorkspace)
|
||||
|
||||
chkGridShowQuickfilter.Checked = LayoutManager.GetFilterRowVisible()
|
||||
chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible()
|
||||
chkGridShowTitle.Checked = LayoutManager.GetBandTitleVisible()
|
||||
@@ -248,11 +255,15 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Sub frmDocumentResultList_Closing(sender As Object, e As CancelEventArgs) Handles Me.FormClosing
|
||||
Try
|
||||
LayoutManager.GridView_SaveLayout(_ActiveGrid.MainView)
|
||||
LayoutManager.Workspace_Save(WorkspaceManager1)
|
||||
LayoutManager.DockManager_SaveLayout(DockManager1)
|
||||
'LayoutManager.GridView_SaveLayout(_ActiveGrid.MainView)
|
||||
'LayoutManager.Workspace_Save(WorkspaceManager1)
|
||||
'LayoutManager.DockManager_SaveLayout(DockManager1)
|
||||
LayoutManager.SaveWindowLocationAndSize(Me)
|
||||
|
||||
Workspace.SaveWorkspaces()
|
||||
Config.Config.SelectedWorkspace = Workspace.CurrentWorkspace
|
||||
Config.Save()
|
||||
|
||||
DocumentViewer1.Done()
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -542,7 +553,7 @@ Public Class frmDocumentResultList
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(0)
|
||||
|
||||
LoadGridData(GridView1, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView1)
|
||||
'LayoutManager.GridView_RestoreLayout(GridView1)
|
||||
CreateDocumentGrid(GridView1, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
@@ -550,7 +561,7 @@ Public Class frmDocumentResultList
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(1)
|
||||
|
||||
LoadGridData(GridView2, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView2)
|
||||
'LayoutManager.GridView_RestoreLayout(GridView2)
|
||||
CreateDocumentGrid(GridView2, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
@@ -558,7 +569,7 @@ Public Class frmDocumentResultList
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(2)
|
||||
|
||||
LoadGridData(GridView3, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView3)
|
||||
'LayoutManager.GridView_RestoreLayout(GridView3)
|
||||
CreateDocumentGrid(GridView3, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
@@ -714,46 +725,6 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GridView1_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
|
||||
|
||||
|
||||
|
||||
'If e.RowHandle <> GridControl.NewItemRowHandle AndAlso e.Column.FieldName = ColumnIcon Then
|
||||
' Dim oRow As DataRow = TryCast(sender, GridView)?.GetDataRow(e.RowHandle)
|
||||
' Dim oValue = oRow.Item(COLUMN_FILENAME)
|
||||
|
||||
' If oValue.ToString.EndsWith(".pdf") Then
|
||||
' Dim oIcon = My.Resources.pdf
|
||||
' e.Cache.DrawImage(oIcon, e.Bounds.X + 0, e.Bounds.Y + 0, 18, 18)
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'Try
|
||||
' If e.RowHandle < 0 Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' e.DefaultDraw()
|
||||
|
||||
' Dim oView As GridView = TryCast(sender, GridView)
|
||||
' Dim oCellInfo As GridCellInfo = TryCast(e.Cell, GridCellInfo)
|
||||
' Dim oRow As DataRow = oView.GetDataRow(e.RowHandle)
|
||||
' Dim oValue = oRow.Item(COLUMN_FILENAME)
|
||||
|
||||
' If e.Column.FieldName = COLUMN_ICON Then
|
||||
' Dim oIcon = Helpers.GetIconByExtension(oValue)
|
||||
' Dim offsetX = 0
|
||||
' Dim offsetY = 0
|
||||
|
||||
' e.Cache.DrawImage(oIcon, e.Bounds.X + offsetX, e.Bounds.Y + offsetY, 18, 18)
|
||||
' End If
|
||||
'Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
'End Try
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItemExportGrid1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemExportGrid1.ItemClick
|
||||
Dim oActiveGrid = GetActiveGridControl()
|
||||
|
||||
@@ -1014,62 +985,28 @@ Public Class frmDocumentResultList
|
||||
#Region "Layout"
|
||||
|
||||
Private Sub BarButtonResetLayout_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonResetGridLayout.ItemClick
|
||||
If Not IsNothing(_ActiveGrid) Then
|
||||
Try
|
||||
Dim oFile = LayoutManager.GetGrid_LayoutName(_ActiveGrid.MainView)
|
||||
If IO.File.Exists(oFile) Then
|
||||
IO.File.Delete(oFile)
|
||||
End If
|
||||
LoadGridDataAndLayout()
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem6_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonResetWindowLayout.ItemClick
|
||||
Try
|
||||
LayoutManager.DockManager_ResetLayout(DockManager1)
|
||||
If Workspace.ResetWorkspaces() Then
|
||||
FormHelper.ShowSuccessMessage("Die gespeicherten Workspaces wurden gelöscht, beim Nächsten Laden wird die Standard-Ansicht geladen.", Text)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged
|
||||
If IsLoading = False Then
|
||||
Config1.Config.SplitContainer1Distance = SplitContainerControl1.SplitterPosition
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SplitContainerControl2_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl2.SplitterPositionChanged
|
||||
If IsLoading = False Then
|
||||
Config1.Config.SplitContainer2Distance = SplitContainerControl2.SplitterPosition
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SwitchMainContainerHorizontal_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchMainContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl1.Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
|
||||
If Config1 IsNot Nothing And IsLoading = False Then
|
||||
Config1.Config.SplitContainer1Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SwitchDetailContainerHorizontal2_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchDetailContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl2.Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
|
||||
If Config1 IsNot Nothing And IsLoading = False Then
|
||||
Config1.Config.SplitContainer2Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
Private Sub ButtonRefresh_ItemClick(sender As Object, e As ItemClickEventArgs) Handles ButtonRefresh.ItemClick
|
||||
RaiseEvent NeedsRefresh(Me, Params.ProfileGuid)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub chkGridShowGrouping_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles chkGridShowGrouping.CheckedChanged
|
||||
If IsLoading = False Then
|
||||
LayoutManager.SetGroupPanelVisible(chkGridShowGrouping.Checked)
|
||||
@@ -1126,7 +1063,27 @@ Public Class frmDocumentResultList
|
||||
GridBuilder.WithFontSizeDelta(Config.Config.GridFontSizeDelta)
|
||||
End Sub
|
||||
|
||||
Private Sub RibbonControl_Click(sender As Object, e As EventArgs) Handles RibbonControl.Click
|
||||
Private Sub btnSaveWorkspace_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btnSaveWorkspace.ItemClick
|
||||
If Workspace.SaveWorkspace(Workspace.CurrentWorkspace, pForce:=True) Then
|
||||
FormHelper.ShowInfoMessage($"Der Workspace '{Workspace.CurrentWorkspace}' wurde erfolgreich gespeichert!", Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSaveWorkspaceAs_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btnSaveWorkspaceAs.ItemClick
|
||||
Dim oWorkspaceName = Nothing
|
||||
|
||||
Dim oArgs As New XtraInputBoxArgs() With {
|
||||
.Caption = "Neuer Workspace",
|
||||
.Prompt = "Bitte vergeben Sie einen Namen für den neuen Workspace:"
|
||||
}
|
||||
Dim oNewName = XtraInputBox.Show(oArgs)
|
||||
If oNewName IsNot Nothing Then
|
||||
oWorkspaceName = oNewName
|
||||
End If
|
||||
|
||||
If oWorkspaceName IsNot Nothing AndAlso Workspace.SaveWorkspace(oWorkspaceName, pForce:=True) Then
|
||||
FormHelper.ShowInfoMessage($"Der Workspace '{oWorkspaceName}' wurde erfolgreich gespeichert!", Text)
|
||||
Workspace.LoadWorkspace(oWorkspaceName)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user