105 lines
2.9 KiB
C#
105 lines
2.9 KiB
C#
///
|
|
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
|
///
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Output.Printers.Enhanced
|
|
{
|
|
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() { return new PrinterCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public PageOrientation PageOrientation;
|
|
public string Template;
|
|
public int TopMargin;
|
|
public int BottomMargin;
|
|
public int LeftMargin;
|
|
public string TitFntFml;
|
|
public string HdrFntFml;
|
|
public string BodyFntFml;
|
|
public string FooterFntFml;
|
|
public int TitFntSz;
|
|
public int HdrFntSz;
|
|
public int BodyFntSz;
|
|
public int FooterFntSz;
|
|
public int TitFntSty;
|
|
public int HdrFntSty;
|
|
public int BodyFntSty;
|
|
public int FooterFntSty;
|
|
public bool GoodOnly;
|
|
public bool SupressPrinting; /// Bypass printing when true
|
|
public Culture Culture;
|
|
public string[] CommonItems;
|
|
public string[] SelectedItems;
|
|
public string Header; /// =Title
|
|
public string Footer;
|
|
public string DocName;
|
|
public int NrOfCopies;
|
|
|
|
public Results.Output.Printers.BarcodeType BarcodeType;
|
|
public int BarcodeWidth;
|
|
public int BarcodeHeight;
|
|
|
|
[XmlIgnore]
|
|
public Config.Entities.MetersKind MetersKind;
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
PrinterCfg()
|
|
{
|
|
}
|
|
|
|
public PrinterCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
|
|
: this()
|
|
{
|
|
Name = name;
|
|
Factory = factory;
|
|
MetersKind = metersKind;
|
|
|
|
ParentName = string.Empty;
|
|
Template = string.Empty;
|
|
PageOrientation = PageOrientation.Portrait;
|
|
TopMargin = 100;
|
|
BottomMargin = 100;
|
|
LeftMargin = 100;
|
|
TitFntFml = "Arial";
|
|
TitFntSz = 18;
|
|
TitFntSty = 1;
|
|
HdrFntFml = "Arial";
|
|
HdrFntSz = 10;
|
|
HdrFntSty = 0;
|
|
BodyFntFml = "Arial";
|
|
BodyFntSz = 10;
|
|
BodyFntSty = 0;
|
|
FooterFntFml = "Arial";
|
|
FooterFntSz = 10;
|
|
FooterFntSty = 0;
|
|
GoodOnly = false;
|
|
SupressPrinting = false;
|
|
Header = string.Empty;
|
|
Footer = string.Empty;
|
|
DocName = string.Empty;
|
|
NrOfCopies = 1;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Orientation={1}, Margins T={2} B={3} L={4}, SupressPrinting={5}",
|
|
Name,
|
|
PageOrientation,
|
|
TopMargin,
|
|
BottomMargin,
|
|
LeftMargin,
|
|
SupressPrinting ? "yes" : "no"
|
|
);
|
|
}
|
|
}
|
|
}
|