DocumentViewer: Add method SetViewOnly

This commit is contained in:
Jonathan Jenne 2020-12-23 14:30:21 +01:00
parent 590407fbce
commit 27cac7dbf0

View File

@ -292,7 +292,7 @@ Public Class DocumentViewer
''' True means that all file info should be hidden from the end-user ''' 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 ''' False means the end user may see the filepath or other info about the file
''' </param> ''' </param>
Public Sub RightOnlyView(ViewOnly As Boolean) Public Sub SetViewOnly(ViewOnly As Boolean)
If ViewOnly Then If ViewOnly Then
buttonPrint.Visibility = XtraBars.BarItemVisibility.Never buttonPrint.Visibility = XtraBars.BarItemVisibility.Never
Else Else
@ -301,6 +301,11 @@ Public Class DocumentViewer
_hide_file_info_from_user = Not ViewOnly _hide_file_info_from_user = Not ViewOnly
End Sub End Sub
Public Sub RightViewOnly(ViewOnly As Boolean)
SetViewOnly(ViewOnly)
End Sub
Private Sub UpdateMainUi() Private Sub UpdateMainUi()
End Sub End Sub
@ -356,79 +361,6 @@ Public Class DocumentViewer
End If End If
GdViewer.PrintDialog() GdViewer.PrintDialog()
'Using f As New frmViewerPrint(GdViewer)
' f.ShowDialog(Me)
' If f.DialogResult <> DialogResult.OK Then
' Return
' End If
' Dim printSettings As frmViewerPrint.PrintSettings = f.printConfiguration
' If Not GdViewer.PrintSetActivePrinter(printSettings.Printer) Then
' Return
' End If
' GdViewer.PrintSetDocumentName("GdPicture Print Job " + DateTime.Now.ToString("yyyy-MM-dd HH\mm"))
' GdViewer.PrintSetAlignment(printSettings.PrintAlignment)
' Select Case printSettings.Orientation
' Case frmViewerPrint.PrintOrientation.AutoDetection
' GdViewer.PrintSetAutoRotation(True)
' Exit Select
' Case frmViewerPrint.PrintOrientation.Portrait
' GdViewer.PrintSetAutoRotation(False)
' GdViewer.PrintSetOrientation(PrinterOrientation.PrinterOrientationPortrait)
' Exit Select
' Case frmViewerPrint.PrintOrientation.Paysage
' GdViewer.PrintSetAutoRotation(False)
' GdViewer.PrintSetOrientation(PrinterOrientation.PrinterOrientationLandscape)
' Exit Select
' End Select
' GdViewer.PrintSetCopies(printSettings.Copies)
' If printSettings.Copies > 1 Then
' GdViewer.PrintSetCollate(printSettings.Collate)
' End If
' Select Case printSettings.PagesToPrint
' Case frmViewerPrint.PagesToPrint.All
' GdViewer.PrintSetFromToPage(1, GdViewer.PageCount)
' GdViewer.Print(printSettings.PrintSize)
' Exit Select
' Case frmViewerPrint.PagesToPrint.Current
' GdViewer.PrintSetFromToPage(GdViewer.CurrentPage, GdViewer.CurrentPage)
' GdViewer.Print(printSettings.PrintSize)
' Exit Select
' Case frmViewerPrint.PagesToPrint.Range
' If printSettings.PageRange IsNot Nothing And printSettings.PageRange <> String.Empty Then
' If printSettings.PageRange.Contains("-") Then
' Dim pageStart As Integer = 0
' If Integer.TryParse(printSettings.PageRange.Split("-"c)(0), pageStart) Then
' Dim pageEnd As Integer = 0
' If Integer.TryParse(printSettings.PageRange.Split("-"c)(1), pageEnd) Then
' If pageEnd < pageStart Then
' GdViewer.PrintSetFromToPage(pageEnd, pageStart)
' GdViewer.Print(printSettings.PrintSize)
' Else
' GdViewer.PrintSetFromToPage(pageStart, pageEnd)
' GdViewer.Print(printSettings.PrintSize)
' End If
' Else
' MessageBox.Show("Page range is invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
' End If
' Else
' MessageBox.Show("Page range is invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
' End If
' Else
' Dim page As Integer = 0
' If Integer.TryParse(printSettings.PageRange, page) Then
' GdViewer.PrintSetFromToPage(page, page)
' GdViewer.Print(printSettings.PrintSize)
' Else
' MessageBox.Show("Page range is invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
' End If
' End If
' Else
' MessageBox.Show("Page range is invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
' End If
' Exit Select
' End Select
'End Using
End Sub End Sub
Private Sub btnRotateLeft_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles buttonRotateLeft.ItemClick Private Sub btnRotateLeft_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles buttonRotateLeft.ItemClick