refactor: Refactor DevExpressSwissQrCodeProcessor to use Codecrete QRBill parser
- Change return type to tuple (Bill, string[]) - Remove custom parsing methods (ParseSwissQrBillContent, MapAddress, DetermineReferenceType) - Use Codecrete QRBill.DecodeQrCodeText() for parsing - Add SkiaSharp.QrCode v1.0.0 for QR decoding - Remove obsolete ZXing and System.Drawing dependencies - Add StringExtensions for QR code detection - Raw lines properly split and trimmed from QR text
This commit is contained in:
16
DocumentOperator.Infrastructure/Services/StringExtensions.cs
Normal file
16
DocumentOperator.Infrastructure/Services/StringExtensions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace DocumentOperator.Infrastructure.Services;
|
||||
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static T? DeserializeXml<T>(this string xmlText)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(xmlText))
|
||||
return default;
|
||||
|
||||
var serializer = new XmlSerializer(typeof(T));
|
||||
using var reader = new StringReader(xmlText);
|
||||
return (T?)serializer.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user