EDMI: Include Doctypes in ClientConfig

This commit is contained in:
Jonathan Jenne
2022-02-04 16:49:05 +01:00
parent d8b1b7e2b7
commit 67852d4572
19 changed files with 1564 additions and 1357 deletions

View File

@@ -54,7 +54,7 @@ Public Class frmDocumentResultList
Private ReadOnly Params As DocumentResultList.Params
Private WithEvents Watcher As DocumentResultList.Watcher
Private _Documentloader As DocumentResultList.Loader
Private Documentloader As DocumentResultList.Loader
' Runtime variables
Private _IsLoading As Boolean = True
@@ -122,9 +122,10 @@ Public Class frmDocumentResultList
OperationMode = GetOperationMode()
If OperationMode = OperationMode.WithAppServer Or OperationMode = OperationMode.ZooFlow Then
InitAppServer()
End If
_Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, _IDBClient, Environment.User)
Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, _IDBClient, Environment.User)
If Params.WindowTitle <> "" Then
Text = $"{Text} - {Params.WindowTitle}"
@@ -204,7 +205,7 @@ Public Class frmDocumentResultList
DocumentViewer1.CloseDocument()
oDocumentInfo = _Documentloader.Load(oObjectId, oFullPath)
oDocumentInfo = Documentloader.Load(oObjectId, oFullPath)
' Check DocumentInfo
If IsNothing(oDocumentInfo) Then
@@ -237,6 +238,15 @@ Public Class frmDocumentResultList
Public Async Sub Watcher_FileChanged(sender As Object, e As DocumentResultList.Watcher.FileChangedArgs) Handles Watcher.FileChanged
Try
Dim oDoctype = Nothing
If e.File.Document.DocumentType IsNot Nothing Then
oDoctype = _IDBClient.ClientConfig.DocumentTypes.
Where(Function(doctype) doctype.Name = e.File.Document.DocumentType).
FirstOrDefault()
End If
Dim oFileInfo = New FileInfo(e.File.FilePath)
Dim oMessage = $"Die Datei '{oFileInfo.Name}' wurde außerhalb des Systems verändert. Wollen Sie diese Änderung als neue Version in das System übernehmen? 'Nein' überschreibt die ursprüngliche Datei."
Dim oResult As DialogResult = MsgBox(oMessage, MsgBoxStyle.YesNoCancel Or MsgBoxStyle.Question, "Datei verändert")
@@ -248,7 +258,7 @@ Public Class frmDocumentResultList
' - Cancel: Abort update
Select Case oResult
Case DialogResult.Cancel
MsgBox("Abbruch!")
' MsgBox("Abbruch!")
Case Else
Dim oCreateNewFileVersion = IIf(oResult = DialogResult.Yes, True, False)
@@ -482,30 +492,30 @@ Public Class frmDocumentResultList
End Try
End Sub
Private Sub GridView1_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
Try
If e.RowHandle < 0 Then
Exit Sub
End If
'Private Sub GridView1_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
' Try
' If e.RowHandle < 0 Then
' Exit Sub
' End If
e.DefaultDraw()
' 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)
' 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
' 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
' 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()
@@ -862,6 +872,10 @@ Public Class frmDocumentResultList
End Try
End Sub
Private Sub RibbonControl_Click(sender As Object, e As EventArgs) Handles RibbonControl.Click
End Sub