Common: ObjectPropertyDialog improvements, DocumentResultList Improvements
This commit is contained in:
@@ -25,61 +25,52 @@ Imports DigitalData.GUIs.Common.Base
|
||||
Public Class frmDocumentResultList
|
||||
Implements IResultForm, IBaseForm
|
||||
|
||||
' These are NOT constants, only defaults
|
||||
' Can be changed when calling frmDocumentResultList
|
||||
Private ReadOnly COLUMN_FILEPATH As String = "FULL_FILENAME"
|
||||
Private ReadOnly COLUMN_FILENAME As String = "Filename"
|
||||
Private ReadOnly COLUMN_DOCID As String = "DocID"
|
||||
Private ReadOnly COLUMN_ICON As String = "ICON"
|
||||
|
||||
' Constants
|
||||
Private Const OPEN_FILE As String = "Datei öffnen"
|
||||
Private Const OPEN_DIRECTORY As String = "Ordner öffnen"
|
||||
Private Const COPY_FILE_PATH As String = "Dateipfad kopieren"
|
||||
Private Const COPY_FOLDER_PATH As String = "Ordnerpfad kopieren"
|
||||
Private Const OPEN_PROPERTIES As String = "Eigenschaften"
|
||||
|
||||
Private Const FILE_OPEN_TIMER_INTERVAL As Integer = 500
|
||||
Private Const SaveWindowLocationAndSize As Integer = 1
|
||||
|
||||
' Interface implementations
|
||||
Private ReadOnly Property LogConfig As LogConfig Implements IBaseForm.LogConfig
|
||||
Private ReadOnly Property Logger As Logger Implements IBaseForm.Logger
|
||||
Public ReadOnly Property ErrorHandler As BaseErrorHandler Implements IBaseForm.ErrorHandler
|
||||
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
|
||||
|
||||
' Helper Classes
|
||||
Private _IDBClient As Client
|
||||
Private Client As Client
|
||||
Private Documentloader As DocumentResultList.Loader
|
||||
Private ControlManager As AttributeControls
|
||||
|
||||
Private ReadOnly Config As ConfigManager(Of DocumentResultList.Config)
|
||||
Private ReadOnly Environment As Environment
|
||||
Private ReadOnly Filesystem As Modules.Filesystem.File
|
||||
Private ReadOnly GridBuilder As GridBuilder
|
||||
Private ReadOnly FileEx As Modules.Windows.File
|
||||
|
||||
Private ReadOnly Helpers As DocumentResultList.Helpers
|
||||
Private ReadOnly Params As DocumentResultList.Params
|
||||
Private ReadOnly LayoutManager As DocumentResultList.Layout
|
||||
|
||||
Private WithEvents Watcher As DocumentResultList.Watcher
|
||||
Private ControlManager As AttributeControls
|
||||
|
||||
Private Documentloader As DocumentResultList.Loader
|
||||
|
||||
' Runtime variables
|
||||
Private Property ResultLists As List(Of DocumentResultList.DocumentResult)
|
||||
|
||||
Private _IsLoading As Boolean = True
|
||||
Private IsLoading As Boolean = True
|
||||
Private _DragBoxFromMouseDown As Rectangle
|
||||
Private _ScreenOffset As Point
|
||||
Private _CurrentDocument As DocumentResultList.Document = Nothing
|
||||
Private ReadOnly _FileOpenList As New Dictionary(Of Integer, String)
|
||||
Private ReadOnly _Language As String
|
||||
Private ReadOnly UserLanguage As String
|
||||
|
||||
Private ReadOnly ColumnFilepath As String = "FULL_FILENAME"
|
||||
Private ReadOnly ColumnFilename As String = "Filename"
|
||||
Private ReadOnly ColumnDocumentId As String = "DocID"
|
||||
Private ReadOnly ColumnIcon As String = "ICON"
|
||||
|
||||
Private Property _ActiveGrid As GridControl = Nothing
|
||||
Private Property _ActiveGridBand As GridBand = Nothing
|
||||
Private Property GridList As List(Of GridControl)
|
||||
Private Property ViewList As List(Of BandedGridView)
|
||||
|
||||
Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
|
||||
|
||||
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
|
||||
|
||||
|
||||
Public Event NeedsRefresh As EventHandler(Of Integer) Implements IResultForm.NeedsRefresh
|
||||
Public Event ResultsRefreshed As EventHandler(Of List(Of DocumentResultList.DocumentResult))
|
||||
@@ -94,10 +85,10 @@ Public Class frmDocumentResultList
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
Dim oConfigPath As String = Path.Combine(Application.UserAppDataPath, "ResultList", pParams.WindowGuid)
|
||||
|
||||
COLUMN_DOCID = pParams.ColumnNames.ObjectIdColumn
|
||||
COLUMN_FILENAME = pParams.ColumnNames.FilenameColumn
|
||||
COLUMN_FILEPATH = pParams.ColumnNames.FullPathColumn
|
||||
COLUMN_ICON = pParams.ColumnNames.IconColumn
|
||||
ColumnDocumentId = pParams.ColumnNames.ObjectIdColumn
|
||||
ColumnFilename = pParams.ColumnNames.FilenameColumn
|
||||
ColumnFilepath = pParams.ColumnNames.FullPathColumn
|
||||
ColumnIcon = pParams.ColumnNames.IconColumn
|
||||
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
@@ -115,7 +106,7 @@ Public Class frmDocumentResultList
|
||||
Watcher = New DocumentResultList.Watcher(pLogConfig)
|
||||
LayoutManager = New DocumentResultList.Layout(pLogConfig, Config, New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
|
||||
_Language = Utils.NotNull(Me.Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
UserLanguage = Utils.NotNull(Me.Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
End Sub
|
||||
|
||||
Private Function GetOperationMode() As OperationMode
|
||||
@@ -144,19 +135,20 @@ Public Class frmDocumentResultList
|
||||
|
||||
End If
|
||||
|
||||
Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, _IDBClient, Environment.User)
|
||||
Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, Client, Environment.User)
|
||||
|
||||
If Params.WindowTitle <> "" Then
|
||||
Text = $"{Text} - {Params.WindowTitle}"
|
||||
End If
|
||||
|
||||
' Initialize Viewer with GDPicture.NET License
|
||||
If Environment.Settings.GdPictureKey = String.Empty Then
|
||||
Throw New ApplicationException("GDPicture Licensekey is missing!")
|
||||
If Environment.Settings.GdPictureKey <> String.Empty Then
|
||||
DocumentViewer1.Init(LogConfig, Environment.Settings.GdPictureKey)
|
||||
End If
|
||||
DocumentViewer1.Init(LogConfig, Environment.Settings.GdPictureKey)
|
||||
|
||||
'Load config
|
||||
LayoutManager.LoadWindowLocationAndSize(Me)
|
||||
LayoutManager.DockManager_RestoreLayout(DockManager1)
|
||||
SplitContainerControl1.SplitterPosition = Config.Config.SplitContainer1Distance
|
||||
SwitchMainContainerHorizontal.Checked = Config.Config.SplitContainer1Horizontal
|
||||
SplitContainerControl2.SplitterPosition = Config.Config.SplitContainer2Distance
|
||||
@@ -174,32 +166,16 @@ Public Class frmDocumentResultList
|
||||
End If
|
||||
|
||||
If OperationMode <> OperationMode.NoAppServer Then
|
||||
' Location and size will be managed by the ZooFlow Search Window
|
||||
If Utils.IsVisibleOnAnyScreen(Config.Config.WindowLocation) Then
|
||||
If Utils.LocationIsVisible(Config.Config.WindowLocation) Then
|
||||
Location = Config.Config.WindowLocation
|
||||
End If
|
||||
If Utils.SizeIsVisible(Config.Config.WindowSize) Then
|
||||
Size = Config.Config.WindowSize
|
||||
End If
|
||||
End If
|
||||
|
||||
CtrlObjectPropertyDialog.Initialize(LogConfig, Me, _IDBClient, Environment)
|
||||
CtrlObjectPropertyDialog.Initialize(LogConfig, Me, Client, Environment)
|
||||
|
||||
SwitchMainContainerHorizontal.Visibility = BarItemVisibility.Never
|
||||
SwitchDetailContainerHorizontal.Visibility = BarItemVisibility.Never
|
||||
End If
|
||||
|
||||
GridBuilder.WithReadOnlyOptions()
|
||||
|
||||
AddHandler GridView1.FocusedRowChanged, AddressOf GridView_FocusedRowChanged
|
||||
AddHandler GridView2.FocusedRowChanged, AddressOf GridView_FocusedRowChanged
|
||||
AddHandler GridView3.FocusedRowChanged, AddressOf GridView_FocusedRowChanged
|
||||
|
||||
UpdateTotalResults()
|
||||
UpdateGridData()
|
||||
LoadGridDataAndLayout()
|
||||
|
||||
LayoutManager.DockManager_RestoreLayout(DockManager1)
|
||||
GridBuilder.WithReadOnlyOptions()
|
||||
|
||||
chkGridShowQuickfilter.Checked = LayoutManager.GetFilterRowVisible()
|
||||
chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible()
|
||||
@@ -209,7 +185,7 @@ Public Class frmDocumentResultList
|
||||
ErrorHandler.ShowErrorMessage(ex, "Error while loading results", "Form Load")
|
||||
|
||||
Finally
|
||||
_IsLoading = False
|
||||
IsLoading = False
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
@@ -218,10 +194,7 @@ Public Class frmDocumentResultList
|
||||
Try
|
||||
LayoutManager.GridView_SaveLayout(_ActiveGrid.MainView)
|
||||
LayoutManager.DockManager_SaveLayout(DockManager1)
|
||||
|
||||
Config.Config.WindowLocation = Location
|
||||
Config.Config.WindowSize = Size
|
||||
Config.Save()
|
||||
LayoutManager.SaveWindowLocationAndSize(Me)
|
||||
|
||||
DocumentViewer1.Done()
|
||||
Catch ex As Exception
|
||||
@@ -229,7 +202,7 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Async Sub GridView_FocusedRowChanged(sender As GridView, e As FocusedRowChangedEventArgs)
|
||||
Private Async Sub GridView_FocusedRowChanged(sender As GridView, e As FocusedRowChangedEventArgs) Handles GridView1.FocusedRowChanged, GridView2.FocusedRowChanged, GridView3.FocusedRowChanged
|
||||
Helpers.SetRowHandle(e)
|
||||
|
||||
Try
|
||||
@@ -237,52 +210,48 @@ Public Class frmDocumentResultList
|
||||
|
||||
If e.FocusedRowHandle >= 0 Then
|
||||
Dim oRow = sender.GetDataRow(Helpers.ActiveRowHandle)
|
||||
Dim oObjectId = oRow.ItemEx(Of Long)(COLUMN_DOCID, 0)
|
||||
Dim oFullPath = oRow.ItemEx(Of String)(COLUMN_FILEPATH, "")
|
||||
Dim oObjectId = oRow.ItemEx(Of Long)(ColumnDocumentId, 0)
|
||||
Dim oFullPath = oRow.ItemEx(ColumnFilepath, "")
|
||||
Dim oDocumentInfo As DocumentResultList.Document = Nothing
|
||||
|
||||
DocumentViewer1.CloseDocument()
|
||||
' Show Ribbon Category
|
||||
RibbonPageCategoryFile.Visible = True
|
||||
|
||||
' Load DocumentInfo
|
||||
oDocumentInfo = Documentloader.Load(oObjectId, oFullPath)
|
||||
|
||||
' Check DocumentInfo
|
||||
If IsNothing(oDocumentInfo) Then
|
||||
DocumentViewer1.CloseDocument()
|
||||
ErrorHandler.ShowErrorMessage("File could not be loaded!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oFileName = $"{oObjectId}.{oDocumentInfo.Extension}"
|
||||
|
||||
DocumentViewer1.LoadFile(oFileName, New MemoryStream(oDocumentInfo.Contents))
|
||||
|
||||
' Save reference to current
|
||||
' Save reference to current document
|
||||
_CurrentDocument = oDocumentInfo
|
||||
|
||||
' Load Document in Document Viewer
|
||||
Dim oFileName = $"{oObjectId}.{oDocumentInfo.Extension}"
|
||||
DocumentViewer1.LoadFile(oFileName, New MemoryStream(oDocumentInfo.Contents))
|
||||
|
||||
' Hide Export and filesystem options for view only right
|
||||
If oDocumentInfo.AccessRight = Rights.AccessRight.VIEW_ONLY Then
|
||||
DocumentViewer1.SetViewOnly(True)
|
||||
RibbonPageExport.Visible = False
|
||||
RibbonPageGroupExport.Visible = False
|
||||
RibbonPageGroupFilesystem.Visible = False
|
||||
Else
|
||||
DocumentViewer1.SetViewOnly(False)
|
||||
RibbonPageExport.Visible = True
|
||||
RibbonPageGroupExport.Visible = True
|
||||
RibbonPageGroupFilesystem.Visible = True
|
||||
End If
|
||||
|
||||
If OperationMode = OperationMode.ZooFlow Or OperationMode = OperationMode.WithAppServer Then
|
||||
Dim oEntityId = 1
|
||||
Dim oAttributes = Await ControlManager.GetAttributesForBusinessEntity(oEntityId)
|
||||
|
||||
If oAttributes.Count = 0 Then
|
||||
MsgBox($"Es konnten keine Attribute für das Objekt '{oObjectId}' geladen werden!", MsgBoxStyle.Critical, Text)
|
||||
End If
|
||||
'Dim oEntityId = 1
|
||||
'Dim oAttributes = Await ControlManager.GetAttributesForBusinessEntity(oEntityId)
|
||||
'If oAttributes.Count = 0 Then
|
||||
' MsgBox($"Es konnten keine Attribute für das Objekt '{oObjectId}' geladen werden!", MsgBoxStyle.Critical, Text)
|
||||
'End If
|
||||
|
||||
Await CtrlObjectPropertyDialog.LoadObject(oObjectId)
|
||||
|
||||
'Await ControlManager.LoadControlsForAttributes(oObjectId, oAttributes, RootMetadata)
|
||||
End If
|
||||
|
||||
RibbonPageCategoryFile.Visible = True
|
||||
Else
|
||||
RibbonPageCategoryFile.Visible = False
|
||||
End If
|
||||
@@ -296,7 +265,7 @@ Public Class frmDocumentResultList
|
||||
#Region "Watcher"
|
||||
|
||||
Public Async Sub Watcher_FileOpened(sender As Object, e As DocumentResultList.Watcher.FileOpenedArgs) Handles Watcher.FileOpened
|
||||
Await _IDBClient.SetObjectStateAsync(e.File.Document.Id, OBJECT_STATE_FILE_OPENED, New Options.SetObjectStateOptions With {
|
||||
Await Client.SetObjectStateAsync(e.File.Document.Id, OBJECT_STATE_FILE_OPENED, New Options.SetObjectStateOptions With {
|
||||
.Language = Environment.User.Language,
|
||||
.Username = Environment.User.UserName
|
||||
})
|
||||
@@ -308,7 +277,7 @@ Public Class frmDocumentResultList
|
||||
Dim oDoctype As GlobalStateDoctype = Nothing
|
||||
|
||||
If e.File.Document.DocumentType IsNot Nothing Then
|
||||
oDoctype = _IDBClient.ClientConfig.DocumentTypes.
|
||||
oDoctype = Client.ClientConfig.DocumentTypes.
|
||||
Where(Function(doctype) doctype.Name = e.File.Document.DocumentType).
|
||||
FirstOrDefault()
|
||||
End If
|
||||
@@ -346,7 +315,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Async Function Watcher_OverwriteFile(pFile As DocumentResultList.Watcher.OpenFile) As Task
|
||||
Await Watcher_UpdateFile(pFile, pCreateNewVersion:=False)
|
||||
Await _IDBClient.SetObjectStateAsync(pFile.Document.Id, OBJECT_STATE_FILE_CHANGED, New Options.SetObjectStateOptions With {
|
||||
Await Client.SetObjectStateAsync(pFile.Document.Id, OBJECT_STATE_FILE_CHANGED, New Options.SetObjectStateOptions With {
|
||||
.Language = Environment.User.Language,
|
||||
.Username = Environment.User.UserName
|
||||
})
|
||||
@@ -354,7 +323,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Async Function Watcher_VersionFile(pFile As DocumentResultList.Watcher.OpenFile) As Task
|
||||
Await Watcher_UpdateFile(pFile, pCreateNewVersion:=True)
|
||||
Await _IDBClient.SetObjectStateAsync(pFile.Document.Id, OBJECT_STATE_FILE_VERSIONED, New Options.SetObjectStateOptions With {
|
||||
Await Client.SetObjectStateAsync(pFile.Document.Id, OBJECT_STATE_FILE_VERSIONED, New Options.SetObjectStateOptions With {
|
||||
.Language = Environment.User.Language,
|
||||
.Username = Environment.User.UserName
|
||||
})
|
||||
@@ -363,7 +332,7 @@ Public Class frmDocumentResultList
|
||||
Private Async Function Watcher_UpdateFile(pFile As DocumentResultList.Watcher.OpenFile, pCreateNewVersion As Boolean) As Task
|
||||
Dim oFileInfo As New FileInfo(pFile.FilePath)
|
||||
Dim oDisplayName As String = pFile.Document.DisplayFileName
|
||||
Dim oObjectId = Await _IDBClient.UpdateFileAsync(pFile.Document.Id, pFile.FilePath, New Options.UpdateFileOptions With {
|
||||
Dim oObjectId = Await Client.UpdateFileAsync(pFile.Document.Id, pFile.FilePath, New Options.UpdateFileOptions With {
|
||||
.CreateNewFileVersion = pCreateNewVersion,
|
||||
.Language = Environment.User.Language,
|
||||
.Username = Environment.User.UserName
|
||||
@@ -401,17 +370,15 @@ Public Class frmDocumentResultList
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Private Function InitAppServer() As Boolean
|
||||
Dim oSplit As List(Of String) = Environment.Service.Address.Split(":").ToList()
|
||||
Dim oAddress As String = oSplit.Item(0)
|
||||
Dim oPort As Integer = oSplit.Item(1)
|
||||
|
||||
_IDBClient = New Client(LogConfig, oAddress, oPort)
|
||||
ControlManager = New AttributeControls(LogConfig, Environment, _IDBClient)
|
||||
Client = New Client(LogConfig, oAddress, oPort)
|
||||
ControlManager = New AttributeControls(LogConfig, Environment, Client)
|
||||
|
||||
If Not _IDBClient.Connect() Then
|
||||
If Not Client.Connect() Then
|
||||
Logger.Warn("Client could not connect to Service at [{0}]", Environment.Service.Address)
|
||||
Return False
|
||||
End If
|
||||
@@ -427,7 +394,7 @@ Public Class frmDocumentResultList
|
||||
Dim oDelegate As New RefreshResultsDelegate(AddressOf RefreshResults)
|
||||
Return GridControl1.Invoke(oDelegate, pResults)
|
||||
Else
|
||||
_IsLoading = True
|
||||
IsLoading = True
|
||||
Try
|
||||
' Save the new results
|
||||
ResultLists = pResults
|
||||
@@ -437,7 +404,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
' Update the grid
|
||||
UpdateTotalResults()
|
||||
UpdateGridData()
|
||||
LoadGridDataAndLayout()
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
@@ -446,18 +413,18 @@ Public Class frmDocumentResultList
|
||||
MessageBox.Show("Error while refreshing results:" & vbNewLine & vbNewLine & ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
Return False
|
||||
Finally
|
||||
_IsLoading = False
|
||||
IsLoading = False
|
||||
End Try
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub LoadGridData(View As GridView, Result As DocumentResultList.DocumentResult)
|
||||
If Result.Datatable.Columns.Contains(COLUMN_DOCID) = False Then
|
||||
Throw New ApplicationException($"Datatable is missing DocId Column [{COLUMN_DOCID}] for search {Result.Title}!")
|
||||
If Result.Datatable.Columns.Contains(ColumnDocumentId) = False Then
|
||||
Throw New ApplicationException($"Datatable is missing DocId Column [{ColumnDocumentId}] for search {Result.Title}!")
|
||||
End If
|
||||
|
||||
If OperationMode = OperationMode.NoAppServer And Result.Datatable.Columns.Contains(COLUMN_FILEPATH) = False Then
|
||||
Throw New ApplicationException($"Datatable is missing Filepath Column [{COLUMN_FILEPATH}] for search {Result.Title}!")
|
||||
If OperationMode = OperationMode.NoAppServer And Result.Datatable.Columns.Contains(ColumnFilepath) = False Then
|
||||
Throw New ApplicationException($"Datatable is missing Filepath Column [{ColumnFilepath}] for search {Result.Title}!")
|
||||
End If
|
||||
|
||||
SetGridDataSource(View, Result.Datatable)
|
||||
@@ -478,7 +445,7 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateGridData()
|
||||
Private Sub LoadGridDataAndLayout()
|
||||
' Load Grids
|
||||
For oIndex = 0 To ResultLists.Count - 1
|
||||
Select Case oIndex
|
||||
@@ -486,24 +453,24 @@ Public Class frmDocumentResultList
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(0)
|
||||
|
||||
LoadGridData(GridView1, oResult)
|
||||
CreateDocumentGrid(GridView1, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView1)
|
||||
CreateDocumentGrid(GridView1, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case 1
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(1)
|
||||
|
||||
LoadGridData(GridView2, oResult)
|
||||
CreateDocumentGrid(GridView2, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView2)
|
||||
CreateDocumentGrid(GridView2, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case 2
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(2)
|
||||
|
||||
LoadGridData(GridView3, oResult)
|
||||
CreateDocumentGrid(GridView3, oResult)
|
||||
LayoutManager.GridView_RestoreLayout(GridView3)
|
||||
CreateDocumentGrid(GridView3, oResult)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case Else
|
||||
@@ -569,8 +536,8 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Sub CreateDocumentGrid(GridView As BandedGridView, Result As DocumentResultList.DocumentResult)
|
||||
Try
|
||||
If IsNothing(GridView.Columns(COLUMN_ICON)) Then
|
||||
Dim oIconColumn = GridView.Columns.AddVisible(COLUMN_ICON, COLUMN_ICON)
|
||||
If IsNothing(GridView.Columns(ColumnIcon)) Then
|
||||
Dim oIconColumn = GridView.Columns.AddVisible(ColumnIcon, ColumnIcon)
|
||||
With oIconColumn
|
||||
.OptionsColumn.AllowSort = False
|
||||
.OptionsColumn.AllowSize = False
|
||||
@@ -586,55 +553,61 @@ Public Class frmDocumentResultList
|
||||
oFirstBand.Columns.MoveTo(0, oIconColumn)
|
||||
End If
|
||||
|
||||
Dim oCreated, oChanged As String
|
||||
If _Language = State.UserState.LANG_DE_DE Then
|
||||
oChanged = "Geändert"
|
||||
oCreated = "Erstellt"
|
||||
Else
|
||||
oCreated = "Created"
|
||||
oChanged = "Changed"
|
||||
End If
|
||||
|
||||
Dim oColumnsToHide As New List(Of String) From {
|
||||
oCreated, oChanged, COLUMN_DOCID, COLUMN_FILEPATH,
|
||||
"CREATED_WHEN", "CREATED_WHO", "ADDED_WHEN", "ADDED_WHO"
|
||||
ColumnDocumentId,
|
||||
ColumnFilepath,
|
||||
ColumnFilename,
|
||||
ColumnIcon,
|
||||
"ADDED_WHEN", "ADDED_WHO", "CHANGED_WHEN", "CHANGED_WHO",
|
||||
"Added when", "Added who", "Changed when", "Changed who"
|
||||
}
|
||||
|
||||
For Each oFieldName As String In oColumnsToHide
|
||||
Try
|
||||
Dim oColumn = GridView.Columns(oFieldName)
|
||||
Dim oColumn = GridView.Columns.
|
||||
Where(Function(column) column.FieldName.ToUpper.Equals(oFieldName.ToUpper)).
|
||||
FirstOrDefault()
|
||||
If oColumn IsNot Nothing Then
|
||||
oColumn.Visible = False
|
||||
oColumn.VisibleIndex = -1
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Next
|
||||
|
||||
Try
|
||||
Dim oFilePathColumn As GridColumn = GridView.Columns(COLUMN_FILEPATH)
|
||||
If Not IsNothing(oFilePathColumn) Then
|
||||
' Hide Fullpath column completely in AppServer-Mode
|
||||
If OperationMode = OperationMode.WithAppServer Then
|
||||
oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False
|
||||
End If
|
||||
End If
|
||||
'Dim oCreated, oChanged As String
|
||||
'If UserLanguage = State.UserState.LANG_DE_DE Then
|
||||
' oChanged = "Geändert"
|
||||
' oCreated = "Erstellt"
|
||||
'Else
|
||||
' oCreated = "Created"
|
||||
' oChanged = "Changed"
|
||||
'End If
|
||||
'Try
|
||||
' Dim oFilePathColumn As GridColumn = GridView.Columns(ColumnFilepath)
|
||||
' If Not IsNothing(oFilePathColumn) Then
|
||||
' ' Hide Fullpath column completely in AppServer-Mode
|
||||
' If OperationMode = OperationMode.WithAppServer Then
|
||||
' oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'Dim oCreatedColumn = GridView.Columns(oCreated)
|
||||
'If Not IsNothing(oCreatedColumn) Then
|
||||
' oCreatedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oCreatedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
'End If
|
||||
' 'Dim oCreatedColumn = GridView.Columns(oCreated)
|
||||
' 'If Not IsNothing(oCreatedColumn) Then
|
||||
' ' oCreatedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' ' oCreatedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
' 'End If
|
||||
|
||||
'Dim oChangedColumn = GridView.Columns(oChanged)
|
||||
'If Not IsNothing(oChangedColumn) Then
|
||||
' oChangedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oChangedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
' 'Dim oChangedColumn = GridView.Columns(oChanged)
|
||||
' 'If Not IsNothing(oChangedColumn) Then
|
||||
' ' oChangedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' ' oChangedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
' 'End If
|
||||
'Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
'End Try
|
||||
|
||||
GridView.OptionsView.BestFitMaxRowCount = 10
|
||||
GridView.OptionsView.BestFitMaxRowCount = 5
|
||||
GridView.BestFitColumns()
|
||||
Catch ex As ApplicationException
|
||||
MsgBox($"Error while loading grid data for search {Result.Title}: {vbNewLine}{vbNewLine}{ex.Message}", MsgBoxStyle.Critical, Text)
|
||||
@@ -698,7 +671,7 @@ Public Class frmDocumentResultList
|
||||
End If
|
||||
|
||||
Else
|
||||
If _Language = State.UserState.LANG_DE_DE Then
|
||||
If UserLanguage = State.UserState.LANG_DE_DE Then
|
||||
MessageBox.Show("Bitte wählen Sie eine Tabelle aus, die Sie exportieren möchten", Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
Else
|
||||
MessageBox.Show("Please select a table that you want to export", Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
@@ -783,7 +756,7 @@ Public Class frmDocumentResultList
|
||||
If IO.File.Exists(oFile) Then
|
||||
IO.File.Delete(oFile)
|
||||
End If
|
||||
UpdateGridData()
|
||||
LoadGridDataAndLayout()
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
@@ -803,31 +776,19 @@ Public Class frmDocumentResultList
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function TestDirectoryExists(pDirectory As String, pTitle As String) As Boolean
|
||||
Private Function TestDirectoryExists(pDirectory As String) As Boolean
|
||||
If _CurrentDocument Is Nothing Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
If Directory.Exists(pDirectory) = False Then
|
||||
MessageBox.Show($"Ordner {pDirectory} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
MessageBox.Show($"Ordner {pDirectory} existiert nicht oder wurde verschoben!", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function TestObjectIdExists(pObjectId As Long, pTitle As String) As Boolean
|
||||
If pObjectId = 0 Then
|
||||
MessageBox.Show($"Objekt {pObjectId} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "File Actions"
|
||||
Private Sub MenuItem_OpenProperties_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesECM.ItemClick
|
||||
If _CurrentDocument Is Nothing Then
|
||||
@@ -839,7 +800,7 @@ Public Class frmDocumentResultList
|
||||
FileEx.OpenFileProperties(_CurrentDocument.FullPath)
|
||||
|
||||
Case Else
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(LogConfig, Environment, _IDBClient, _CurrentDocument.Id)
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(LogConfig, Environment, Client, _CurrentDocument.Id)
|
||||
oPropertyDialog.Show()
|
||||
End Select
|
||||
End Sub
|
||||
@@ -850,7 +811,12 @@ Public Class frmDocumentResultList
|
||||
End Sub
|
||||
|
||||
Private Sub MenuItem_CopyFilepath_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFilepathCopy.ItemClick
|
||||
Clipboard.SetText(_CurrentDocument.FullPath)
|
||||
If _CurrentDocument IsNot Nothing Then
|
||||
Dim oPath = Utils.NotNull(_CurrentDocument.FullPath, "")
|
||||
If oPath <> String.Empty Then
|
||||
Clipboard.SetText(oPath)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Async Sub MenuItem_OpenFile_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFileOpen.ItemClick
|
||||
@@ -864,7 +830,7 @@ Public Class frmDocumentResultList
|
||||
Private Sub MenuItem_FolderOpen_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFolderOpen.ItemClick
|
||||
Dim oFolderPath = Path.GetDirectoryName(_CurrentDocument.FullPath)
|
||||
|
||||
If TestDirectoryExists(oFolderPath, OPEN_DIRECTORY) = False Then
|
||||
If TestDirectoryExists(oFolderPath) = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -918,13 +884,13 @@ Public Class frmDocumentResultList
|
||||
#End Region
|
||||
#Region "Layout"
|
||||
Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged
|
||||
If _IsLoading = False Then
|
||||
If IsLoading = False Then
|
||||
Config.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
|
||||
If IsLoading = False Then
|
||||
Config.Config.SplitContainer2Distance = SplitContainerControl2.SplitterPosition
|
||||
End If
|
||||
End Sub
|
||||
@@ -932,7 +898,7 @@ Public Class frmDocumentResultList
|
||||
Private Sub SwitchMainContainerHorizontal_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchMainContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl1.Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
|
||||
If Config IsNot Nothing And _IsLoading = False Then
|
||||
If Config IsNot Nothing And IsLoading = False Then
|
||||
Config.Config.SplitContainer1Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
@@ -940,7 +906,7 @@ Public Class frmDocumentResultList
|
||||
Private Sub SwitchDetailContainerHorizontal2_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchDetailContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl2.Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
|
||||
If Config IsNot Nothing And _IsLoading = False Then
|
||||
If Config IsNot Nothing And IsLoading = False Then
|
||||
Config.Config.SplitContainer2Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
@@ -962,20 +928,28 @@ Public Class frmDocumentResultList
|
||||
|
||||
|
||||
Private Sub chkGridShowGrouping_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles chkGridShowGrouping.CheckedChanged
|
||||
If _IsLoading = False Then
|
||||
If IsLoading = False Then
|
||||
LayoutManager.SetGroupPanelVisible(chkGridShowGrouping.Checked)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub chkGridShowQuickfilter_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles chkGridShowQuickfilter.CheckedChanged
|
||||
If _IsLoading = False Then
|
||||
If IsLoading = False Then
|
||||
LayoutManager.SetFilterRowVisible(chkGridShowQuickfilter.Checked)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub chkGridShowTitle_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles chkGridShowTitle.CheckedChanged
|
||||
If _IsLoading = False Then
|
||||
If IsLoading = False Then
|
||||
LayoutManager.SetBandTitleVisible(chkGridShowTitle.Checked)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Async Sub MenuItemSaveProperties_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemSaveProperties.ItemClick
|
||||
Await CtrlObjectPropertyDialog.SaveChanges()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem11_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem11.ItemClick
|
||||
GridView1.ShowCustomization()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user