Files
Print_server/Inspectron.Epson.Templates/TemplateReceiptConverterFactory.cs
2026-01-21 15:56:37 +01:00

23 lines
842 B
C#

using Inspectron.Epson.PrintServer.Printers.Utils;
using Inspectron.Epson.Templates.Configuration;
namespace Inspectron.Epson.Templates;
public class TemplateReceiptConverterFactory : IReceiptConverterFactory
{
private readonly TemplateEngine _engine;
private readonly PrinterProfileRegistry _profileRegistry;
public TemplateReceiptConverterFactory(TemplateEngine engine, PrinterProfileRegistry profileRegistry)
{
_engine = engine ?? throw new ArgumentNullException(nameof(engine));
_profileRegistry = profileRegistry ?? throw new ArgumentNullException(nameof(profileRegistry));
}
public IReceiptConverter Create(int receiptType, byte printerId)
{
var profile = _profileRegistry.GetProfile(printerId);
return new TemplateReceiptConverter(_engine, receiptType, profile);
}
}