/// /// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using Config.Entities; using TBF.BenchControl.Generic; namespace TBF.BenchControl.ResultsPrinters.LabelPrinter { public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg { public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); } /// /// Serialized parameters /// public PageOrientation PageOrientation; public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count public string TemplateFile; /// Full path to a 'png' file public bool SupressPrinting; /// true = Bypass printing /// Private parameterless constructor invoked by all other (public) constructors PrinterCfg() { Name = "LabelPrinter"; ParentName = string.Empty; PageOrientation = PageOrientation.Portrait; PaperWidth = 827; /// A4 width PaperHeight = 1169; /// A4 height TemplateFile = "C:\\TBF\\Templates\\Label.png"; SupressPrinting = false; } public PrinterCfg(IComponentFactory factory) : this() { this.Factory = factory; } public string ToString(int i) { return string.Format("Name={0}, Orientation={1}, PaperWidth={2}, PaperHeight={3}, TemplateFile={4}, SupressPrinting={5}", Name, PageOrientation, PaperWidth, PaperHeight, TemplateFile, SupressPrinting ? "yes" : "no" ); } } }