Unterstützung für MSG/EML-Dateien hinzugefügt

Aktualisierung der `App.config` mit neuen `bindingRedirect`-Versionen und Hinzufügen von Abhängigkeiten wie `OpenMcdf` und `Microsoft.Bcl.AsyncInterfaces`.
Erweiterung von `DocumentViewer.vb` zur Unterstützung von `.MSG`- und `.EML`-Dateien, inklusive Konvertierung von `.MSG` zu HTML.
Verbesserte Fehlerbehandlung und Logging.
Einführung der Eigenschaft `SnappingEnabled` in `SnapPanel.vb` und Optimierung des Rasters.
Erweiterte Validierung und Logging in `frmDocumentResultList.vb`.
Aktualisierung der Projektdateien mit neuen Paketverweisen und Abhängigkeitsversionen.
Anpassung der Assembly-Versionen in `AssemblyInfo.vb`.
This commit is contained in:
Developer01
2026-10-26 11:23:37 +01:00
parent e1f670875a
commit 6aa691e1a0
8 changed files with 243 additions and 97 deletions

View File

@@ -380,26 +380,32 @@ Public Class frmDocumentResultList
oDocument = Documentloader.Load(oObjectId, oFullPath)
If oDocument Is Nothing Then
_Logger.Warn("GridView_FocusedRowChanged: Documentloader returned Nothing for ObjectId [{0}], FullPath [{1}]", oObjectId, oFullPath)
Exit Sub
End If
UpdateRibbonActions(oDocument)
If IsNothing(oDocument) Then
DocumentViewer1.CloseDocument()
FormHelper.ShowErrorMessage(New IOException("File could not be loaded!"), "GridView_FocusedRowChanged")
Exit Sub
End If
' Save reference to current document
_CurrentDocument = oDocument
' Load Document in Document Viewer
Dim oFileName = $"{oObjectId}.{oDocument.Extension}"
If Not IsNothing(oDocument.Contents) And CopyWM2Temp = False Then
_Logger.Debug("Loading document into viewer with MemoryStream handler (LoadFile_FromStream). ObjectId: [{0}], Filename: [{1}], FullPath: [{2}]", oObjectId, oFileName, oFullPath)
' Stream-Pfad: Inhalt liegt bereits im Speicher
_Logger.Debug("Loading document via MemoryStream. ObjectId: [{0}], Filename: [{1}]", oObjectId, oFileName)
DocumentViewer1.LoadFile_FromStream(oFileName, New MemoryStream(oDocument.Contents))
Else
' Datei-Pfad: Pfad auflösen und vorab prüfen
Dim oResolvedFilename As String = oFullPath
If CopyWM2Temp = True AndAlso Not String.IsNullOrWhiteSpace(oResolvedFilename) Then
' Pfad-Validierung: Leer oder nicht gesetzt?
If String.IsNullOrWhiteSpace(oResolvedFilename) Then
_Logger.Warn("GridView_FocusedRowChanged: FullPath ist leer für ObjectId [{0}] – Dokument wird nicht geladen.", oObjectId)
DocumentViewer1.CloseDocument()
Exit Sub
End If
If CopyWM2Temp = True Then
Dim options As New DocumentPathHandler.DocumentPathOptions With {
.EnableMapping = True,
.WMSuffix = WM_SUFFIX,
@@ -411,19 +417,24 @@ Public Class frmDocumentResultList
}
Dim result = _documentPathHandler.ProcessDocumentPath(oResolvedFilename, options)
If result.Success AndAlso Not String.IsNullOrWhiteSpace(result.FinalPath) AndAlso File.Exists(result.FinalPath) Then
_Logger.Info($"✓ Zusatzdokument via Temp aufgelöst: [{result.FinalPath}]")
_Logger.Info("✓ Dokument via Temp aufgelöst: [{0}]", result.FinalPath)
oResolvedFilename = result.FinalPath
Else
_Logger.Warn($"⚠️ Temp-Auflösung fehlgeschlagen für [{oResolvedFilename}]: {result.ErrorMessage} - Fallback auf Originalpfad")
_Logger.Warn("⚠️ Temp-Auflösung fehlgeschlagen für [{0}]: {1} – Fallback auf Originalpfad", oResolvedFilename, result.ErrorMessage)
oResolvedFilename = oFullPath
End If
Else
_Logger.Debug("Keine Temp-Kopie für Dokument erforderlich oder möglich. Originalpfad wird verwendet. ObjectId: [{0}], Filename: [{1}], FullPath: [{2}]", oObjectId, oFileName, oFullPath)
End If
_Logger.Debug("Loading document into viewer from filepath (LoadFile_FromPath). ObjectId: [{0}], Filename: [{1}], FullPath: [{2}]", oObjectId, oFileName, oResolvedFilename)
' Pfad-Validierung: Existiert die Datei?
If Not File.Exists(oResolvedFilename) Then
_Logger.Warn("GridView_FocusedRowChanged: Datei existiert nicht [{0}] für ObjectId [{1}] – Dokument wird nicht geladen.", oResolvedFilename, oObjectId)
DocumentViewer1.CloseDocument()
Exit Sub
End If
_Logger.Debug("Loading document from filepath. ObjectId: [{0}], Filename: [{1}], FullPath: [{2}]", oObjectId, oFileName, oResolvedFilename)
DocumentViewer1.LoadFile_FromPath(oResolvedFilename)
End If
'End If
If OperationMode = OperationMode.ZooFlow Or OperationMode = OperationMode.WithAppServer Then
Await CtrlObjectPropertyDialog.LoadObject(oObjectId)