/// /// Copyright (c) 2020 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using Config.Entities; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Output.Printers.MultiLabel { public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PrinterCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl(IList cmpntEntities) { return new PrinterCfgCtrl(); } /// /// Serialized parameters /// public PageOrientation PageOrientation; public int LabelColumnsCount; public int LeftTopLabelLeft; public int LeftTopLabelTop; public int NrOfCopies; public bool GoodOnly; public string[] ItemsToPrint; public int LabelWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count public int LabelHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count public string Template; /// Full path to a 'png' file public string FontFamily; public int FontSize; public int FontStyle; public Culture Culture; public Results.Output.Printers.BarcodeType BarcodeType; public int BarcodeLeft; public int BarcodeTop; public int BarcodeWidth; public int BarcodeHeight; /// Private parameterless constructor invoked by all other (public) constructors PrinterCfg() { } public PrinterCfg(string name, IComponentFactory factory) : this() { this.Name = name; this.Factory = factory; ParentName = string.Empty; Template = string.Empty; PageOrientation = PageOrientation.Portrait; LabelWidth = 827; /// A4 width LabelHeight = 1169; /// A4 height FontFamily = "Arial"; FontSize = 10; FontStyle = 0; NrOfCopies = 1; GoodOnly = false; BarcodeType = Results.Output.Printers.BarcodeType.None; } public string ToString(int i) { return string.Format("Name={0}, Orientation={1}, LabelClmnsCnt={2}, LabelW={3}, LabelH={4}, Barcode={5}, TemplateFile={6}", Name, PageOrientation, LabelColumnsCount, LabelWidth, LabelHeight, BarcodeType.ToString(), Template ); } } }