You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed some inconsistent behavior when iterating over a PdfAcroFieldCollection.
Iterating using the enumerator returns objects of type PdfItem
Accessing the collection using indexes returns objects of type PdfAcroField
I believe this behavior should be aligned, so the virtual GetEnumerator() method from PdfArray should be overridden in PdfAcroFieldCollection to use the same PdfAcroFieldCollection.CreateAcroField(pdfDictonary) method as in the indexer.
Also, this method doesn't have any reason to be a private instance method, it can be a public static one as it does not access instance data. This would be helpful since we cannot instantiate any PdfAcroField subtype because their constructors are internal.
I would be happy to create a PR for this change.
Let me know your thoughts on this,
Sabin
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have noticed some inconsistent behavior when iterating over a PdfAcroFieldCollection.
I believe this behavior should be aligned, so the virtual GetEnumerator() method from PdfArray should be overridden in PdfAcroFieldCollection to use the same PdfAcroFieldCollection.CreateAcroField(pdfDictonary) method as in the indexer.
Also, this method doesn't have any reason to be a private instance method, it can be a public static one as it does not access instance data. This would be helpful since we cannot instantiate any PdfAcroField subtype because their constructors are internal.
I would be happy to create a PR for this change.
Let me know your thoughts on this,
Sabin
Beta Was this translation helpful? Give feedback.
All reactions