Introduced a configurable DelayMilliseconds property to the WorkerOptions class with validation to ensure the value is at least 1 millisecond. This allows for customizable delay settings in worker operations.
37 lines
997 B
C#
37 lines
997 B
C#
namespace EnvelopeGenerator.ServiceHost.Jobs;
|
|
|
|
public class WorkerOptions
|
|
{
|
|
private int _delayMilliseconds = 1000;
|
|
|
|
public int DelayMilliseconds
|
|
{
|
|
get => _delayMilliseconds;
|
|
set
|
|
{
|
|
if (value < 1)
|
|
throw new ArgumentOutOfRangeException(nameof(value), "Delay must be at least 1 millisecond.");
|
|
|
|
_delayMilliseconds = value;
|
|
}
|
|
}
|
|
|
|
public string GdPictureLicenseKey { get; set; } = null!;
|
|
|
|
public PDFBurnerOptions PdfBurner { get; set; } = new();
|
|
|
|
public record PDFBurnerOptions
|
|
{
|
|
public List<string> IgnoredLabels { get; set; } = ["Date", "Datum", "ZIP", "PLZ", "Place", "Ort", "Position", "Stellung"];
|
|
|
|
public double TopMargin { get; set; } = 0.1;
|
|
|
|
public double YOffset { get; set; } = -0.3;
|
|
|
|
public string FontName { get; set; } = "Arial";
|
|
|
|
public int FontSize { get; set; } = 8;
|
|
|
|
public FontStyle FontStyle { get; set; } = FontStyle.Italic;
|
|
}
|
|
} |