DocumentViewer: Replace IndependentSoft with Limilabs.Mail
This commit is contained in:
parent
04dec3495b
commit
1e98befca1
@ -1,14 +1,15 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.ComponentModel
|
||||
Imports System.Globalization
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Independentsoft.Msg
|
||||
Imports DevExpress.Spreadsheet
|
||||
Imports GdPicture14
|
||||
Imports DevExpress
|
||||
Imports DevExpress.Office.Utils
|
||||
Imports System.IO
|
||||
Imports DevExpress.Spreadsheet
|
||||
Imports DevExpress.XtraRichEdit.Commands
|
||||
Imports DevExpress.XtraRichEdit
|
||||
Imports DevExpress.Office.Utils
|
||||
Imports GdPicture14
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Messaging
|
||||
|
||||
Public Class DocumentViewer
|
||||
Private Enum ZoomMode
|
||||
@ -35,6 +36,7 @@ Public Class DocumentViewer
|
||||
Private _licenseManager As New GdPicture14.LicenseManager()
|
||||
Private _logConfig As LogConfig
|
||||
Private _logger As Logger
|
||||
Private _email As Email2
|
||||
|
||||
Private _hide_file_info_from_user As Boolean = False
|
||||
Private _FilePath As String
|
||||
@ -55,13 +57,13 @@ Public Class DocumentViewer
|
||||
''' <summary>
|
||||
''' Initialize the Viewer
|
||||
''' </summary>
|
||||
''' <param name="LogConfig">A LogConfig object</param>
|
||||
''' <param name="LicenseKey">The GDPicture.NET License Key</param>
|
||||
Public Sub Init(LogConfig As LogConfig, LicenseKey As String)
|
||||
_logConfig = LogConfig
|
||||
_logger = LogConfig.GetLogger()
|
||||
|
||||
_licenseKey = LicenseKey
|
||||
''' <param name="pLogConfig">A LogConfig object</param>
|
||||
''' <param name="pLicenseKey">The GDPicture.NET License Key</param>
|
||||
Public Sub Init(pLogConfig As LogConfig, pLicenseKey As String)
|
||||
_logConfig = pLogConfig
|
||||
_logger = pLogConfig.GetLogger()
|
||||
_email = New Email2(pLogConfig)
|
||||
_licenseKey = pLicenseKey
|
||||
_licenseManager.RegisterKEY(_licenseKey)
|
||||
End Sub
|
||||
|
||||
@ -186,23 +188,10 @@ Public Class DocumentViewer
|
||||
SpreadsheetControl1.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.None
|
||||
|
||||
'ToolbarDocumentViewer.Visible = False
|
||||
|
||||
Select Case oExtension.ToUpper
|
||||
Case ".MSG"
|
||||
Dim oMsg As New Message(FilePath)
|
||||
' TODO: Improve Encoding, maybe convert based on encoding
|
||||
oMsg.Encoding = System.Text.Encoding.UTF32
|
||||
Dim oMime = oMsg.ConvertToMimeMessage()
|
||||
Dim oTempFileName = IO.Path.GetTempFileName()
|
||||
oMime.Save(oTempFileName, True)
|
||||
|
||||
RichEditControl1.LoadDocument(oTempFileName, XtraRichEdit.DocumentFormat.Mht)
|
||||
|
||||
_TempFiles.Add(oTempFileName)
|
||||
|
||||
RichEditControl1.Visible = True
|
||||
RichEditControl1.Dock = DockStyle.Fill
|
||||
Dim oEmlPath As String = _email.Convert_ToEml(FilePath)
|
||||
DoLoadFile(oEmlPath)
|
||||
|
||||
Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||
RichEditControl1.LoadDocument(FilePath, GetDocumentFormat(oExtension))
|
||||
@ -245,24 +234,18 @@ Public Class DocumentViewer
|
||||
SpreadsheetControl1.Visible = False
|
||||
SpreadsheetControl1.Dock = DockStyle.None
|
||||
|
||||
' ToolbarDocumentViewer.Visible = False
|
||||
|
||||
Select Case Extension.ToUpper
|
||||
Case ".MSG"
|
||||
Dim oMsg As New Message(Stream)
|
||||
|
||||
' TODO: Improve Encoding, maybe convert based on encoding
|
||||
oMsg.Encoding = System.Text.Encoding.UTF32
|
||||
Dim oMime = oMsg.ConvertToMimeMessage()
|
||||
Dim oTempFileName = IO.Path.GetTempFileName()
|
||||
oMime.Save(oTempFileName, True)
|
||||
Dim oTempFileName = Path.Combine(IO.Path.GetTempPath(), Guid.NewGuid.ToString & ".msg")
|
||||
Using oFileStream As New FileStream(oTempFileName, FileMode.Create)
|
||||
Stream.Seek(0, SeekOrigin.Begin)
|
||||
Stream.CopyTo(oFileStream)
|
||||
Stream.Flush()
|
||||
End Using
|
||||
|
||||
RichEditControl1.LoadDocument(oTempFileName, XtraRichEdit.DocumentFormat.Mht)
|
||||
|
||||
_TempFiles.Add(oTempFileName)
|
||||
|
||||
RichEditControl1.Visible = True
|
||||
RichEditControl1.Dock = DockStyle.Fill
|
||||
Dim oEmlPath As String = _email.Convert_ToEml(oTempFileName)
|
||||
DoLoadFile(oEmlPath)
|
||||
|
||||
Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
|
||||
RichEditControl1.LoadDocument(Stream, GetDocumentFormat(Extension))
|
||||
|
||||
@ -73,9 +73,6 @@
|
||||
<Reference Include="GdPicture.NET.14">
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Independentsoft.Msg, Version=2.0.570.21482, Culture=neutral, PublicKeyToken=76be97fe952f1ec7, processorArchitecture=MSIL">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\22_11_19\Independentsoft.Msg.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
||||
@ -176,6 +173,10 @@
|
||||
<Project>{903B2D7D-3B80-4BE9-8713-7447B704E1B0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Messaging\Messaging.vbproj">
|
||||
<Project>{af664d85-0a4b-4bab-a2f8-83110c06553a}</Project>
|
||||
<Name>Messaging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user