diff --git a/Controls.DocumentViewer/DocumentViewer.Designer.vb b/Controls.DocumentViewer/DocumentViewer.Designer.vb index f68aebe7..43146318 100644 --- a/Controls.DocumentViewer/DocumentViewer.Designer.vb +++ b/Controls.DocumentViewer/DocumentViewer.Designer.vb @@ -346,7 +346,7 @@ Partial Class DocumentViewer ' 'SpreadsheetControl1 ' - Me.SpreadsheetControl1.Location = New System.Drawing.Point(31, 152) + Me.SpreadsheetControl1.Location = New System.Drawing.Point(83, 177) Me.SpreadsheetControl1.MenuManager = Me.BarManager1 Me.SpreadsheetControl1.Name = "SpreadsheetControl1" Me.SpreadsheetControl1.ReadOnly = True @@ -377,30 +377,21 @@ Partial Class DocumentViewer ' 'RichEditControl1 ' - Me.RichEditControl1.Location = New System.Drawing.Point(395, 238) + Me.RichEditControl1.Location = New System.Drawing.Point(571, 238) Me.RichEditControl1.MenuManager = Me.BarManager1 Me.RichEditControl1.Name = "RichEditControl1" Me.RichEditControl1.Size = New System.Drawing.Size(400, 200) Me.RichEditControl1.TabIndex = 5 Me.RichEditControl1.Visible = False ' - 'lblInfo - ' - Me.lblInfo.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.lblInfo.AutoSize = True - Me.lblInfo.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblInfo.ForeColor = System.Drawing.Color.Red - Me.lblInfo.Location = New System.Drawing.Point(3, 533) - Me.lblInfo.Name = "lblInfo" - Me.lblInfo.Size = New System.Drawing.Size(47, 15) - Me.lblInfo.TabIndex = 10 - Me.lblInfo.Text = "Infotext" - ' 'DocumentViewer ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.BackColor = System.Drawing.SystemColors.ControlLightLight + Me.Controls.Add(Me.RichEditControl1) + Me.Controls.Add(Me.lbFileNotLoaded) + Me.Controls.Add(Me.SpreadsheetControl1) + Me.Controls.Add(Me.GdViewer) Me.Controls.Add(Me.barDockControlLeft) Me.Controls.Add(Me.barDockControlRight) Me.Controls.Add(Me.barDockControlBottom) diff --git a/Controls.DocumentViewer/DocumentViewer.resx b/Controls.DocumentViewer/DocumentViewer.resx index 35b2f2dc..249559ce 100644 --- a/Controls.DocumentViewer/DocumentViewer.resx +++ b/Controls.DocumentViewer/DocumentViewer.resx @@ -164,6 +164,26 @@ NC42LTAuOCw2LjUtMi4xbDcuOSw3LjljMC4zLDAuMywwLjksMC4zLDEuMiwwbDEuMi0xLjJDMzAuMSwy OC4yLDMwLjEsMjcuNiwyOS43LDI3LjN6IE00LDEzYzAtNSw0LTksOS05YzUsMCw5LDQsOSw5ICAgcy00 LDktOSw5QzgsMjIsNCwxOCw0LDEzeiIgY2xhc3M9IkJsYWNrIiAvPg0KICA8L2c+DQo8L3N2Zz4L + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANoCAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJs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xhY2siIC8+DQogIDwvZz4N - Cjwvc3ZnPgs= diff --git a/Controls.DocumentViewer/DocumentViewer.vb b/Controls.DocumentViewer/DocumentViewer.vb index de848ea2..f9e46f29 100644 --- a/Controls.DocumentViewer/DocumentViewer.vb +++ b/Controls.DocumentViewer/DocumentViewer.vb @@ -492,12 +492,6 @@ Public Class DocumentViewer End Sub Private Function DoLoadFile(FilePath As String, Optional ViewOverride As String = "") As Boolean Try - ' Ensure the embedded GdViewer control exists before using it - If Not EnsureViewerReady() Then - _logger?.Warn("GdViewer control is not initialized yet. Delaying load.") - Return False - End If - lblInfo.Visible = False Dim oFileInfo = New FileInfo(FilePath) Dim oExtension As String = oFileInfo.Extension.ToUpper @@ -510,6 +504,14 @@ Public Class DocumentViewer SpreadsheetControl1.Dock = DockStyle.None RichEditControl1.Dock = DockStyle.None + Dim override_Spreadsheet As Boolean = False + If oExtension.ToLower = ".xlsx" Then + If oFileInfo.Length > 15000 Then + _logger.Info("Override") + override_Spreadsheet = True + End If + End If + If ViewOverride = "Richtext" Then RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension)) RichEditControl1.Visible = True @@ -519,6 +521,16 @@ Public Class DocumentViewer _ViewerMode = ViewerMode.Richtext lblInfo.Visible = True lblInfo.Text = "This docx-file contains a generic error and will be displayed in a reduced viewer. Please try to open the file in WORD" + ElseIf override_Spreadsheet = True Then + Dim oFormat = GetSpreadsheetFormat(oExtension) + SpreadsheetControl1.LoadDocument(FilePath, oFormat) + + Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange() + oRange.AutoFitColumns() + + SpreadsheetControl1.Visible = True + GdViewer.Visible = False + SpreadsheetControl1.Dock = DockStyle.Fill Else _ViewOverride = "" Select Case oExtension.ToUpper @@ -533,6 +545,12 @@ Public Class DocumentViewer GdViewer.Visible = False SpreadsheetControl1.Dock = DockStyle.Fill + 'Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT" + ' RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension)) + + ' RichEditControl1.Visible = True + ' GdViewer.Visible = False + ' RichEditControl1.Dock = DockStyle.Fill Case Else Select Case oExtension.ToUpper Case ".EML", ".DOC", ".DOCX", ".XLS", ".XLSX", ".ODT", ".RTF", ".TXT" @@ -578,8 +596,111 @@ Public Class DocumentViewer Return False End Try End Function + Private Function DoLoadFile(FilePath As String) As Boolean + Try + ' Ensure the embedded GdViewer control exists before using it + If Not EnsureViewerReady() Then + _logger?.Warn("GdViewer control is not initialized yet. Delaying load.") + Return False + End If + + lblInfo.Visible = False + Dim oFileInfo = New FileInfo(FilePath) + Dim oExtension As String = oFileInfo.Extension.ToUpper + + lbFileNotLoaded.Visible = False + + SpreadsheetControl1.Visible = False + RichEditControl1.Visible = False + + SpreadsheetControl1.Dock = DockStyle.None + RichEditControl1.Dock = DockStyle.None + Dim Override_SSheet_Filesize As Boolean = False + If oExtension.ToLower = ".xlsx" Then + If oFileInfo.Length > 100000 Then + _logger.Info("Override Spreadsheet as xlsx is too big") + Override_SSheet_Filesize = True + End If + End If + If Override_SSheet_Filesize Then + Dim oFormat = GetSpreadsheetFormat(oExtension) + SpreadsheetControl1.LoadDocument(FilePath, oFormat) + + Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange() + oRange.AutoFitColumns() + + If ViewOverride = "Richtext" Then + RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension)) + RichEditControl1.Visible = True + GdViewer.Visible = False + RichEditControl1.Dock = DockStyle.Fill + _ViewOverride = "Richtext" + _ViewerMode = ViewerMode.Richtext + lblInfo.Visible = True + lblInfo.Text = "This docx-file contains a generic error and will be displayed in a reduced viewer. Please try to open the file in WORD" + Else + _ViewOverride = "" + Select Case oExtension.ToUpper + Case ".CSV" + Dim oFormat = GetSpreadsheetFormat(oExtension) + SpreadsheetControl1.LoadDocument(FilePath, oFormat) + + Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange() + oRange.AutoFitColumns() + + SpreadsheetControl1.Visible = True + GdViewer.Visible = False + SpreadsheetControl1.Dock = DockStyle.Fill + Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT" + RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension)) + + RichEditControl1.Visible = True + GdViewer.Visible = False + RichEditControl1.Dock = DockStyle.Fill + Case Else + GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer + GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter + GdViewer.ForceTemporaryMode = True + GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter + If Viewer_ForceTemporaryMode = True Then + GdViewer.ForceTemporaryMode = True + End If + + GdViewer.AnnotationDropShadow = True + GdViewer.BackColor = Color.White + + Dim oGDPState As GdPicture14.GdPictureStatus = GdViewer.DisplayFromFile(FilePath) + If oGDPState <> GdPictureStatus.OK Then + _logger.Warn($"GdPictureStatus is [{oGDPState}]") + If oExtension.ToUpper = ".DOCX" And oGDPState = GdPictureStatus.GenericError Then + DoLoadFile(FilePath, "Richtext") + Else + Dim oFileName = IO.Path.GetFileName(FilePath) + lbFileNotLoaded.Text = String.Format("Datei konnte nicht geladen werden:{0}{1}", vbCrLf, oFileName) + lbFileNotLoaded.Visible = True + End If + + Else + If GdViewer.Visible = False Then + GdViewer.Visible = True + End If + End If + + End Select + + + Return True + Catch ex As Exception + _logger.Error(ex) + Return False + End Try + End Function ' Ensures the embedded GdViewer control exists and is added to the visual tree + Private Function EnsureViewerReady() As Boolean + Try + ' If the control field is Nothing (e.g., designer not yet created), try to lazy-create and add it + If GdViewer Is Nothing Then Private Function EnsureViewerReady() As Boolean Try ' If the control field is Nothing (e.g., designer not yet created), try to lazy-create and add it @@ -659,6 +780,41 @@ Public Class DocumentViewer Return False End Try End Function + Private Function StreamFile(Stream As Stream, Extension As String) As Boolean + Try + + SpreadsheetControl1.Visible = False + SpreadsheetControl1.Dock = DockStyle.None + + Select Case Extension.ToUpper + + Case ".CSV" + SpreadsheetControl1.LoadDocument(Stream, GetSpreadsheetFormat(Extension)) + + Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange() + oRange.AutoFitColumns() + + SpreadsheetControl1.Visible = True + SpreadsheetControl1.Dock = DockStyle.Fill + + Case Else + GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer + GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter + GdViewer.ForceTemporaryMode = True + GdViewer.AnnotationDropShadow = True + + GdViewer.DisplayFromStream(Stream) + + End Select + + UpdateMainUi() + + Return True + Catch ex As Exception + _logger.Error(ex) + Return False + End Try + End Function Private Function GetSpreadsheetFormat(Extension) As Spreadsheet.DocumentFormat Dim oFormat As Spreadsheet.DocumentFormat = Spreadsheet.DocumentFormat.Undefined diff --git a/Controls.SnapPanel/My Project/AssemblyInfo.vb b/Controls.SnapPanel/My Project/AssemblyInfo.vb index becaa04b..43d36dc4 100644 --- a/Controls.SnapPanel/My Project/AssemblyInfo.vb +++ b/Controls.SnapPanel/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' indem Sie "*" wie unten gezeigt eingeben: ' - - + + diff --git a/Controls.SnapPanel/SnapPanel.vb b/Controls.SnapPanel/SnapPanel.vb index 9225b058..ec2cac17 100644 --- a/Controls.SnapPanel/SnapPanel.vb +++ b/Controls.SnapPanel/SnapPanel.vb @@ -1,20 +1,28 @@ Imports System.Drawing Imports System.Windows.Forms + + Public Class ClassSnapPanel Inherits Panel Private _ShowGrid As Boolean = True Private _GridSize As Integer = 16 + Private _NeedsScrollUpdate As Boolean = False + Public Sub New() - Me.AutoScroll = True ' Scrollbars aktivieren + Me.AutoScroll = True + Me.DoubleBuffered = True ' Flackern reduzieren End Sub + Public Property GridSize As Integer Get Return _GridSize End Get Set(value As Integer) - _GridSize = value - Refresh() + If value > 0 AndAlso value <> _GridSize Then + _GridSize = value + Invalidate() + End If End Set End Property @@ -23,55 +31,146 @@ Public Class ClassSnapPanel Return _ShowGrid End Get Set(value As Boolean) - _ShowGrid = value - Refresh() + If value <> _ShowGrid Then + _ShowGrid = value + Invalidate() + End If End Set End Property Protected Overrides Sub OnControlAdded(e As ControlEventArgs) - AddHandler e.Control.LocationChanged, AddressOf AlignToGrid - AddHandler e.Control.DragDrop, AddressOf AlignToGrid MyBase.OnControlAdded(e) - UpdateScrollArea() + AddHandler e.Control.LocationChanged, AddressOf AlignToGrid + AddHandler e.Control.MouseUp, AddressOf AlignToGrid + ScheduleScrollUpdate() End Sub Protected Overrides Sub OnControlRemoved(e As ControlEventArgs) - RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid - RemoveHandler e.Control.DragDrop, AddressOf AlignToGrid MyBase.OnControlRemoved(e) - UpdateScrollArea() + RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid + RemoveHandler e.Control.MouseUp, AddressOf AlignToGrid + ScheduleScrollUpdate() End Sub - Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) - If _ShowGrid Then - ControlPaint.DrawGrid(e.Graphics, ClientRectangle, New Size(_GridSize, _GridSize), BackColor) - End If + Protected Overrides Sub OnLayout(levent As LayoutEventArgs) + MyBase.OnLayout(levent) + ScheduleScrollUpdate() + End Sub + + Protected Overrides Sub OnPaint(e As PaintEventArgs) MyBase.OnPaint(e) + + If Not Me.DesignMode AndAlso _ShowGrid Then + Dim scrollOffset As Point = Me.AutoScrollPosition + Dim gridRect As New Rectangle(-scrollOffset.X, -scrollOffset.Y, Me.ClientSize.Width, Me.ClientSize.Height) + ControlPaint.DrawGrid(e.Graphics, gridRect, New Size(_GridSize, _GridSize), Me.BackColor) + End If End Sub Private Sub AlignToGrid(sender As Object, e As EventArgs) - If _ShowGrid Then - Dim item As Control = CType(sender, Control) - Dim x As Integer = Math.Round(item.Left / _GridSize) * _GridSize - Dim y As Integer = Math.Round(item.Top / _GridSize) * _GridSize - item.Location = New Point(x, y) - UpdateScrollArea() + If Not _ShowGrid OrElse Me.DesignMode Then Return + + Dim ctrl As Control = CType(sender, Control) + Dim x As Integer = Math.Floor(ctrl.Left / _GridSize) * _GridSize + Dim y As Integer = Math.Floor(ctrl.Top / _GridSize) * _GridSize + ctrl.Location = New Point(x, y) + ScheduleScrollUpdate() + End Sub + + Private Sub ScheduleScrollUpdate() + If Not _NeedsScrollUpdate Then + _NeedsScrollUpdate = True + BeginInvoke(New MethodInvoker(Sub() + UpdateScrollArea() + _NeedsScrollUpdate = False + End Sub)) End If End Sub + Private Sub UpdateScrollArea() Dim maxWidth As Integer = 0 Dim maxHeight As Integer = 0 - ' Größte X- und Y-Koordinate der enthaltenen Controls bestimmen - For Each ctrl As Control In Controls - Dim right As Integer = ctrl.Right - Dim bottom As Integer = ctrl.Bottom - - If right > maxWidth Then maxWidth = right - If bottom > maxHeight Then maxHeight = bottom + For Each ctrl As Control In Me.Controls + maxWidth = Math.Max(maxWidth, ctrl.Right) + maxHeight = Math.Max(maxHeight, ctrl.Bottom) Next - ' Scrollbereich setzen Me.AutoScrollMinSize = New Size(maxWidth, maxHeight) End Sub End Class + +'Public Class ClassSnapPanel +' Inherits Panel + +' Private _ShowGrid As Boolean = True +' Private _GridSize As Integer = 16 +' Public Sub New() +' Me.AutoScroll = True ' Scrollbars aktivieren +' End Sub +' Public Property GridSize As Integer +' Get +' Return _GridSize +' End Get +' Set(value As Integer) +' _GridSize = value +' Refresh() +' End Set +' End Property + +' Public Property ShowGrid As Boolean +' Get +' Return _ShowGrid +' End Get +' Set(value As Boolean) +' _ShowGrid = value +' Refresh() +' End Set +' End Property + +' Protected Overrides Sub OnControlAdded(e As ControlEventArgs) +' AddHandler e.Control.LocationChanged, AddressOf AlignToGrid +' AddHandler e.Control.DragDrop, AddressOf AlignToGrid +' MyBase.OnControlAdded(e) +' UpdateScrollArea() +' End Sub + +' Protected Overrides Sub OnControlRemoved(e As ControlEventArgs) +' RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid +' RemoveHandler e.Control.DragDrop, AddressOf AlignToGrid +' MyBase.OnControlRemoved(e) +' UpdateScrollArea() +' End Sub +' Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) +' If _ShowGrid Then +' ControlPaint.DrawGrid(e.Graphics, ClientRectangle, New Size(_GridSize, _GridSize), BackColor) +' End If +' MyBase.OnPaint(e) +' End Sub + +' Private Sub AlignToGrid(sender As Object, e As EventArgs) +' If _ShowGrid Then +' Dim item As Control = CType(sender, Control) +' Dim x As Integer = Math.Round(item.Left / _GridSize) * _GridSize +' Dim y As Integer = Math.Round(item.Top / _GridSize) * _GridSize +' item.Location = New Point(x, y) +' UpdateScrollArea() +' End If +' End Sub +' Private Sub UpdateScrollArea() +' Dim maxWidth As Integer = 0 +' Dim maxHeight As Integer = 0 + +' ' Größte X- und Y-Koordinate der enthaltenen Controls bestimmen +' For Each ctrl As Control In Controls +' Dim right As Integer = ctrl.Right +' Dim bottom As Integer = ctrl.Bottom + +' If right > maxWidth Then maxWidth = right +' If bottom > maxHeight Then maxHeight = bottom +' Next + +' ' Scrollbereich setzen +' Me.AutoScrollMinSize = New Size(maxWidth, maxHeight) +' End Sub +'End Class diff --git a/GUIs.Common/Common.vbproj b/GUIs.Common/Common.vbproj index 1db8604c..e75de04d 100644 --- a/GUIs.Common/Common.vbproj +++ b/GUIs.Common/Common.vbproj @@ -132,68 +132,68 @@ ..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.1d.writer.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.barcode.1d.writer.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.2d.writer.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.barcode.2d.writer.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.CAD.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.DWG.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.CAD.DWG.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Common.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Common.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Document.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Document.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Email.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Email.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.HTML.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.HTML.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Formats.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.Conversion.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Formats.Conversion.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Rendering.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Rendering.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.MSOfficeBinary.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.MSOfficeBinary.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenDocument.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenDocument.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenXML.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.Templating.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenXML.Templating.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.PDF.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.PDF.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.RTF.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.RTF.dll - - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.SVG.dll + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.SVG.dll - ..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.wia.gateway.dll + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.wia.gateway.dll True @@ -209,6 +209,12 @@ ..\packages\Microsoft.IdentityModel.Abstractions.6.22.0\lib\net461\Microsoft.IdentityModel.Abstractions.dll + + ..\packages\GdPicture.14.3.19\lib\net462\NativeSDK.Settings.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\NativeSDK.Settings.Edition.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -821,8 +827,8 @@ - + - + \ No newline at end of file diff --git a/GUIs.Common/app.config b/GUIs.Common/app.config index 0f74ee4e..9e43e045 100644 --- a/GUIs.Common/app.config +++ b/GUIs.Common/app.config @@ -103,6 +103,18 @@ + + + + + + + + + + + + diff --git a/GUIs.Common/packages.config b/GUIs.Common/packages.config index 8abe7a31..5d3992cc 100644 --- a/GUIs.Common/packages.config +++ b/GUIs.Common/packages.config @@ -6,8 +6,8 @@ - - + + diff --git a/GUIs.Test.TestGUI/My Project/licenses.licx b/GUIs.Test.TestGUI/My Project/licenses.licx index cb7c55fb..78d6cc83 100644 --- a/GUIs.Test.TestGUI/My Project/licenses.licx +++ b/GUIs.Test.TestGUI/My Project/licenses.licx @@ -1 +1 @@ -DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraSpreadsheet.SpreadsheetControl, DevExpress.XtraSpreadsheet.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/GUIs.Test.TestGUI/TestGUI.vbproj b/GUIs.Test.TestGUI/TestGUI.vbproj index f036ba40..2b171b5d 100644 --- a/GUIs.Test.TestGUI/TestGUI.vbproj +++ b/GUIs.Test.TestGUI/TestGUI.vbproj @@ -78,8 +78,7 @@ - - False + ..\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll diff --git a/GUIs.Test.TestGUI/frmDocViewPure.Designer.vb b/GUIs.Test.TestGUI/frmDocViewPure.Designer.vb index b00c6a6a..51b9c632 100644 --- a/GUIs.Test.TestGUI/frmDocViewPure.Designer.vb +++ b/GUIs.Test.TestGUI/frmDocViewPure.Designer.vb @@ -22,18 +22,10 @@ Partial Class frmDocViewPure 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.SpreadsheetControl1 = New DevExpress.XtraSpreadsheet.SpreadsheetControl() Me.Button1 = New System.Windows.Forms.Button() + Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() Me.SuspendLayout() ' - 'SpreadsheetControl1 - ' - Me.SpreadsheetControl1.Location = New System.Drawing.Point(349, 187) - Me.SpreadsheetControl1.Name = "SpreadsheetControl1" - Me.SpreadsheetControl1.Size = New System.Drawing.Size(400, 200) - Me.SpreadsheetControl1.TabIndex = 0 - Me.SpreadsheetControl1.Text = "SpreadsheetControl1" - ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(546, 25) @@ -43,19 +35,26 @@ Partial Class frmDocViewPure Me.Button1.Text = "unload" Me.Button1.UseVisualStyleBackColor = True ' + 'DocumentViewer1 + ' + Me.DocumentViewer1.FileLoaded = False + Me.DocumentViewer1.Location = New System.Drawing.Point(12, 54) + Me.DocumentViewer1.Name = "DocumentViewer1" + Me.DocumentViewer1.Size = New System.Drawing.Size(661, 386) + Me.DocumentViewer1.TabIndex = 2 + ' 'frmDocViewPure ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.DocumentViewer1) Me.Controls.Add(Me.Button1) - Me.Controls.Add(Me.SpreadsheetControl1) Me.Name = "frmDocViewPure" Me.Text = "frmDocViewPure" Me.ResumeLayout(False) End Sub - - Friend WithEvents SpreadsheetControl1 As DevExpress.XtraSpreadsheet.SpreadsheetControl Friend WithEvents Button1 As Button + Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer End Class diff --git a/GUIs.Test.TestGUI/frmDocViewPure.vb b/GUIs.Test.TestGUI/frmDocViewPure.vb index 2fa3fe66..0b55c54c 100644 --- a/GUIs.Test.TestGUI/frmDocViewPure.vb +++ b/GUIs.Test.TestGUI/frmDocViewPure.vb @@ -2,7 +2,6 @@ Public Class frmDocViewPure Private Sub frmDocViewPure_Load(sender As Object, e As EventArgs) Handles MyBase.Load - SpreadsheetControl1.LoadDocument("E:\35MB.xlsx") End Sub @@ -10,7 +9,7 @@ Public Class frmDocViewPure 'SpreadsheetControl1.Document.Dispose() 'SpreadsheetControl1.Dispose() 'SpreadsheetControl1 = Nothing - SpreadsheetControl1.CreateNewDocument() + ' SpreadsheetControl1.CreateNewDocument() GC.Collect() End Sub End Class \ No newline at end of file diff --git a/GUIs.Test.ZUGFeRDTest/App.config b/GUIs.Test.ZUGFeRDTest/App.config index d5a18172..1da1135b 100644 --- a/GUIs.Test.ZUGFeRDTest/App.config +++ b/GUIs.Test.ZUGFeRDTest/App.config @@ -161,7 +161,15 @@ - + + + + + + + + + diff --git a/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb b/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb index b68b9537..addd06e6 100644 --- a/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb +++ b/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb @@ -252,7 +252,7 @@ Partial Class Form1 ' ' Form1 ' - AutoScaleDimensions = New System.Drawing.SizeF(8F, 20F) + AutoScaleDimensions = New System.Drawing.SizeF(8.0F, 20.0F) AutoScaleMode = AutoScaleMode.Font ClientSize = New System.Drawing.Size(879, 690) Controls.Add(Button2) @@ -296,6 +296,4 @@ Partial Class Form1 Friend WithEvents btWriteBinary As Button Friend WithEvents ButtonValidateXMLOnly As Button Friend WithEvents OpenFileDialog2 As OpenFileDialog - Friend WithEvents Button1 As Button - Friend WithEvents Button2 As Button End Class diff --git a/GUIs.Test.ZUGFeRDTest/Form1.vb b/GUIs.Test.ZUGFeRDTest/Form1.vb index aebbdcb7..7800d254 100644 --- a/GUIs.Test.ZUGFeRDTest/Form1.vb +++ b/GUIs.Test.ZUGFeRDTest/Form1.vb @@ -99,14 +99,14 @@ Public Class Form1 Dim oEN16931_ID = oRow.Item("EN16931_ID") Args.PropertyMapList.Add(New XmlItemProperty() With { - .XMLPath = xmlPath, - .Description = description, - .TableName = tableName, - .TableColumn = tableColumn, - .IsRequired = isRequired, - .IsGrouped = isGrouped, - .GroupScope = groupScope, - .Specification = specification, + .xmlPath = xmlPath, + .description = description, + .tableName = tableName, + .tableColumn = tableColumn, + .isRequired = isRequired, + .isGrouped = isGrouped, + .groupScope = groupScope, + .specification = specification, .ItemType = oItemType, .EN16931_ID = oEN16931_ID }) diff --git a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj index 1c9fbff1..f541b57f 100644 --- a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj +++ b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj @@ -23,6 +23,9 @@ + + ..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll + ..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll @@ -38,6 +41,161 @@ ..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll + + ..\packages\DocumentFormat.OpenXml.3.2.0\lib\net46\DocumentFormat.OpenXml.dll + + + ..\packages\DocumentFormat.OpenXml.Framework.3.2.0\lib\net46\DocumentFormat.OpenXml.Framework.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.barcode.1d.writer.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.barcode.2d.writer.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.CAD.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.CAD.DWG.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Common.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Document.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Email.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.HTML.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Formats.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Formats.Conversion.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.Imaging.Rendering.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.MSOfficeBinary.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenDocument.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenXML.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.OpenXML.Templating.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.PDF.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.RTF.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.SVG.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\GdPicture.NET.14.wia.gateway.dll + True + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + + ..\packages\GdPicture.14.3.19\lib\net462\NativeSDK.Settings.dll + + + ..\packages\GdPicture.14.3.19\lib\net462\NativeSDK.Settings.Edition.dll + + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll + + + ..\packages\NLog.5.1.0\lib\net46\NLog.dll + + + ..\packages\OpenMcdf.2.4.1\lib\net40\OpenMcdf.dll + + + ..\packages\protobuf-net.3.2.46\lib\net462\protobuf-net.dll + + + ..\packages\protobuf-net.Core.3.2.46\lib\net462\protobuf-net.Core.dll + + + ..\packages\RtfPipe.2.0.7677.4303\lib\net45\RtfPipe.dll + + + + ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll + + + + + + + ..\packages\System.IO.Packaging.8.0.1\lib\net462\System.IO.Packaging.dll + + + + ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + + ..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll + + + + ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + + + ..\packages\System.Security.Cryptography.Pkcs.8.0.1\lib\net462\System.Security.Cryptography.Pkcs.dll + + + + ..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.8.0.6\lib\net462\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + + + + + + + @@ -54,5 +212,12 @@ SettingsSingleFileGenerator - - + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + + \ No newline at end of file diff --git a/GUIs.Test.ZUGFeRDTest/packages.config b/GUIs.Test.ZUGFeRDTest/packages.config index 8e3163f9..29c65262 100644 --- a/GUIs.Test.ZUGFeRDTest/packages.config +++ b/GUIs.Test.ZUGFeRDTest/packages.config @@ -4,8 +4,8 @@ - - + + @@ -18,17 +18,14 @@ - - - - + \ No newline at end of file diff --git a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs index c1a7e580..0ac2c0e8 100644 --- a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs +++ b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs @@ -465,7 +465,7 @@ namespace ZUGFeRDRESTService.Controllers var language = "de-DE"; var searchTitle = "ZUGFERD_Rejection_" + pErrorCode + "_Web"; - var messageItem = _RecjectionMessageList.Where(i => i.Title.Equals(searchTitle, StringComparison.OrdinalIgnoreCase) && i.Language == language).FirstOrDefault(); + var messageItem = _RecjectionMessageList.Where(i => i.Title.Equals(searchTitle, StringComparison.OrdinalIgnoreCase) && i.Language.Equals(language, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (messageItem != null) { _logger.Info("GetRejectionMessage() - messageItem: '" + messageItem.String1 + "'");