Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposal for #242. This is just an example -- I didn't move everything that could be moved. For the most part I left the code as-is after moving it. I targeted .net 6 without putting much thought into it. I'm sure we could target a bit lower if desired. My goal was to keep dependencies out of
QRCoder2.Payloads
I pulled payloads out of
PayloadGeneratorinto their own classes. Other libraries can expose newPayloadsby referencingQRCoder2and extendingPayloadBase.QR Code data
QRCodeGeneratortranslates aPayloadBasetoQRCodeData. I didn't change anything here, except movingECCLevelandEciModeto the Payloads namespace.Renderers
I added a renderers namespace. I put a couple of the "easy" QR codes that had no dependencies there:
PngByteQRCodeandBitmapByteQRCode. I think the*QRCodeclasses should then be renamed*QRCodeRenderer. As an example, I added a library forQRCoder2.Renderers.ImageSharpwhich has a dependency on ImageSharp (but does nothing at the moment). Other library authors could provide their own renderers using onlyQRCoder2as a dependency.