refactor(pdf-burner): replace annotation type constants with AnnotationType class
- Removed individual annotation type constants (ANNOTATION_TYPE_IMAGE, ANNOTATION_TYPE_INK, ANNOTATION_TYPE_WIDGET) - Introduced new Friend Class `AnnotationType` to encapsulate annotation type string constants - Updated all references to use `AnnotationType.Image`, `AnnotationType.Ink`, and `AnnotationType.Widget` - Improved code organization by grouping related constants and removing redundant declarations
This commit is contained in:
@@ -20,9 +20,6 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Private ReadOnly Manager As AnnotationManager
|
Private ReadOnly Manager As AnnotationManager
|
||||||
Private ReadOnly LicenseManager As LicenseManager
|
Private ReadOnly LicenseManager As LicenseManager
|
||||||
|
|
||||||
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
|
|
||||||
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
|
|
||||||
Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget"
|
|
||||||
Private Property _pdfBurnerParams As PDFBurnerParams
|
Private Property _pdfBurnerParams As PDFBurnerParams
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
|
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
|
||||||
@@ -106,16 +103,13 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
||||||
|
|
||||||
Select Case oAnnotation.type
|
Select Case oAnnotation.type
|
||||||
Case ANNOTATION_TYPE_IMAGE
|
Case AnnotationType.Image
|
||||||
|
|
||||||
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
||||||
Exit Select
|
Exit Select
|
||||||
|
Case AnnotationType.Ink
|
||||||
Case ANNOTATION_TYPE_INK
|
|
||||||
AddInkAnnotation(oAnnotation)
|
AddInkAnnotation(oAnnotation)
|
||||||
Exit Select
|
Exit Select
|
||||||
|
Case AnnotationType.Widget
|
||||||
Case ANNOTATION_TYPE_WIDGET
|
|
||||||
'Add form field values
|
'Add form field values
|
||||||
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
||||||
If formFieldValue IsNot Nothing AndAlso Not _pdfBurnerParams.IgnoredLabels.Contains(formFieldValue.value) Then
|
If formFieldValue IsNot Nothing AndAlso Not _pdfBurnerParams.IgnoredLabels.Contains(formFieldValue.value) Then
|
||||||
@@ -196,6 +190,12 @@ Namespace Jobs.FinalizeDocument
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Model"
|
#Region "Model"
|
||||||
|
Friend Class AnnotationType
|
||||||
|
Public Const Image As String = "pspdfkit/image"
|
||||||
|
Public Const Ink As String = "pspdfkit/ink"
|
||||||
|
Public Const Widget As String = "pspdfkit/widget"
|
||||||
|
End Class
|
||||||
|
|
||||||
Friend Class AnnotationData
|
Friend Class AnnotationData
|
||||||
Public Property annotations As List(Of Annotation)
|
Public Property annotations As List(Of Annotation)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user