fix labels showing default values, clear up _view_only variable use
This commit is contained in:
parent
e013fd4a25
commit
d7bbd08a36
@ -25,7 +25,8 @@ Public Class DocumentViewer
|
|||||||
Private _licenseManager As New GdPicture14.LicenseManager()
|
Private _licenseManager As New GdPicture14.LicenseManager()
|
||||||
Private _logConfig As LogConfig
|
Private _logConfig As LogConfig
|
||||||
Private _logger As Logger
|
Private _logger As Logger
|
||||||
Private _view_only As Boolean = False
|
|
||||||
|
Private _hide_file_info_from_user As Boolean = False
|
||||||
|
|
||||||
' List of all created temp files when converting msg files
|
' List of all created temp files when converting msg files
|
||||||
Private _TempFiles As New List(Of String)
|
Private _TempFiles As New List(Of String)
|
||||||
@ -90,10 +91,6 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
DoLoadFile(FilePath)
|
DoLoadFile(FilePath)
|
||||||
|
|
||||||
If _view_only Then
|
|
||||||
statusLabel.Text = FilePath
|
|
||||||
End If
|
|
||||||
|
|
||||||
UpdateMainUi()
|
UpdateMainUi()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -141,12 +138,15 @@ Public Class DocumentViewer
|
|||||||
|
|
||||||
RichEditControl1.Visible = True
|
RichEditControl1.Visible = True
|
||||||
RichEditControl1.Dock = DockStyle.Fill
|
RichEditControl1.Dock = DockStyle.Fill
|
||||||
|
|
||||||
|
Me.infoLabel.Text = "Type: " & "MSG Email File"
|
||||||
Case ".EML"
|
Case ".EML"
|
||||||
RichEditControl1.LoadDocument(FilePath, DevExpress.XtraRichEdit.DocumentFormat.Mht)
|
RichEditControl1.LoadDocument(FilePath, DevExpress.XtraRichEdit.DocumentFormat.Mht)
|
||||||
|
|
||||||
RichEditControl1.Visible = True
|
RichEditControl1.Visible = True
|
||||||
RichEditControl1.Dock = DockStyle.Fill
|
RichEditControl1.Dock = DockStyle.Fill
|
||||||
|
|
||||||
|
Me.infoLabel.Text = "Type: " & "EML Email File"
|
||||||
Case ".XLSX", ".XLS", "CSV"
|
Case ".XLSX", ".XLS", "CSV"
|
||||||
Dim oFormat As DevExpress.Spreadsheet.DocumentFormat = Undefined
|
Dim oFormat As DevExpress.Spreadsheet.DocumentFormat = Undefined
|
||||||
|
|
||||||
@ -164,13 +164,22 @@ Public Class DocumentViewer
|
|||||||
SpreadsheetControl1.Visible = True
|
SpreadsheetControl1.Visible = True
|
||||||
SpreadsheetControl1.Dock = DockStyle.Fill
|
SpreadsheetControl1.Dock = DockStyle.Fill
|
||||||
|
|
||||||
|
Me.infoLabel.Text = "Type: " & "Excel/CSV File"
|
||||||
Case Else
|
Case Else
|
||||||
_logger.Info("Displaying file {0}", FilePath)
|
_logger.Info("Displaying file {0}", FilePath)
|
||||||
|
|
||||||
mainToolStrip.Visible = True
|
mainToolStrip.Visible = True
|
||||||
|
|
||||||
GdViewer.DisplayFromFile(FilePath)
|
GdViewer.DisplayFromFile(FilePath)
|
||||||
|
|
||||||
|
Me.infoLabel.Text = "Type: " & GetDocumentTypeLabel()
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
If _hide_file_info_from_user Then
|
||||||
|
statusLabel.Text = String.Empty
|
||||||
|
Else
|
||||||
|
statusLabel.Text = "Path: " & FilePath
|
||||||
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex)
|
_logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
@ -207,14 +216,21 @@ Public Class DocumentViewer
|
|||||||
Return result
|
Return result
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub RightOnlyView(ValueRight As Boolean)
|
''' <summary>
|
||||||
If ValueRight Then
|
''' Configures the viewer to hide the file path to the end-user.
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="ViewOnly">
|
||||||
|
''' True means that all file info should be hidden from the end-user
|
||||||
|
''' False means the end user may see the filepath or other info about the file
|
||||||
|
''' </param>
|
||||||
|
Public Sub RightOnlyView(ViewOnly As Boolean)
|
||||||
|
If ViewOnly Then
|
||||||
btnPrint.Visible = False
|
btnPrint.Visible = False
|
||||||
Else
|
Else
|
||||||
btnPrint.Visible = True
|
btnPrint.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_view_only = ValueRight
|
_hide_file_info_from_user = Not ViewOnly
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub UpdateMainUi()
|
Private Sub UpdateMainUi()
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -483,24 +499,6 @@ Public Class DocumentViewer
|
|||||||
btnLastPage.Enabled = True
|
btnLastPage.Enabled = True
|
||||||
End If
|
End If
|
||||||
cbZoom.Text = String.Format(CultureInfo.InvariantCulture, "{0:#0.##%}", GdViewer.Zoom)
|
cbZoom.Text = String.Format(CultureInfo.InvariantCulture, "{0:#0.##%}", GdViewer.Zoom)
|
||||||
|
|
||||||
|
|
||||||
Dim widthInches, heightInches As Double
|
|
||||||
|
|
||||||
If GdViewer.GetDocumentType = DocumentType.DocumentTypePDF Then
|
|
||||||
widthInches = GdViewer.PdfGetPageWidth / 72
|
|
||||||
heightInches = GdViewer.PdfGetPageHeight / 72
|
|
||||||
Else
|
|
||||||
widthInches = GdViewer.PageWidth / GdViewer.HorizontalResolution
|
|
||||||
heightInches = GdViewer.PageHeight / GdViewer.VerticalResolution
|
|
||||||
End If
|
|
||||||
|
|
||||||
Me.infoLabel.Text = "Type: " + GetDocumentTypeLabel() + " - " +
|
|
||||||
"Pagesize (zoll): " + Trim(Str(Math.Round(widthInches, 2))) + " × " + Trim(Str(Math.Round(heightInches, 2))) + " - " +
|
|
||||||
"Pagesize (pixel): " + Trim(Str(GdViewer.PageWidth)) + " × " + Trim(Str(GdViewer.PageHeight)) + " - " +
|
|
||||||
"Horizontal resolution: " + Trim(Str(Math.Round(GdViewer.HorizontalResolution, 2))) + " DPI - " +
|
|
||||||
"Vertical resolution: " + Trim(Str(Math.Round(GdViewer.VerticalResolution, 2))) + " DPI"
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnFitWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFitWidth.Click
|
Private Sub btnFitWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFitWidth.Click
|
||||||
|
|||||||
@ -482,9 +482,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
|
|
||||||
' PropertyMap items with `IsGrouped = False` are handled normally
|
' PropertyMap items with `IsGrouped = False` are handled normally
|
||||||
Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = oArgs.PropertyMap.
|
Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = oArgs.PropertyMap.
|
||||||
Where(Function(Item As KeyValuePair(Of String, XmlItemProperty))
|
Where(Function(Item) Item.Value.IsGrouped = True).
|
||||||
Return Item.Value.IsGrouped = False
|
|
||||||
End Function).
|
|
||||||
ToDictionary(Function(Item) Item.Key,
|
ToDictionary(Function(Item) Item.Key,
|
||||||
Function(Item) Item.Value)
|
Function(Item) Item.Value)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user