This is more of a streamlining question regarding Overloading, Inheritance, and polymorphism.
I'm trying to feed a pdfdefinition and dwfdefinition through the same code. Both derived from NOD:UnderlayDefinition.
Here is the PDF code. I have a DWF version that exactly the same word-for-word except variable names.
Dim pdfFN As String = pdfObj.SourceFileName
Dim pdfAFN As String
Try
pdfAFN = pdfObj.ActiveFileName
Catch ex As Exception
pdfAFN = "Error"
End Try
Dim pdfPath As String = Mid(pdfFN, 1, pdfFN.LastIndexOf("\") + 1)
Dim pdfFile As String = Mid(pdfFN, pdfFN.LastIndexOf("\") + 2)
If pdfObj.Loaded = False Then
If pdfAFN = "Error" Then
Dim xrefData = New XrefData(pdfFile, xrefStatus.MR)
BatcherMainDialog.xrefProp.Add(xrefData)
Else
Dim xrefData = New XrefData(pdfFile, xrefstatus.UL)
BatcherMainDialog.xrefProp.Add(xrefData)
End If
ElseIf pdfPath <> Mid(doc.Name, doc.Name.LastIndexOf("\") + 2) Then
Dim xrefData = New XrefData(pdfFile, xrefstatus.CR)
BatcherMainDialog.xrefProp.Add(xrefData)
End If
XrefData is a class holding two strings Xref file name and attachment issue
XrefStatus is a read only class supplying error messages to various attachment issues.
I've considered overloading but I can't seem to get a clean differentiation between the two types that doesn't end up with separate code paths.
I've read various explanations and code samples for polymorphism... but I think I'm having a brain block, cuz it's not sinking in.
Thanks for your help.