Refactorization : BenchControl -> Rig
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.Zapiska
|
||||
{
|
||||
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<Config.Entities.Component> cmpntEntities) { 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 SupressPrinting; /// Bypass printing when true
|
||||
public Culture Culture;
|
||||
public bool GoodOnly;
|
||||
|
||||
public string Header; /// =Title
|
||||
|
||||
public int ColW0Pct;
|
||||
public string[] CommonItems1;
|
||||
public int ColW1Pct;
|
||||
public string[] CommonItems2;
|
||||
public int ColW2Pct;
|
||||
public string[] CommonItems3;
|
||||
|
||||
public string[] SelectedItems;
|
||||
|
||||
public int BelowW0Pct;
|
||||
public string[] BelowItems1;
|
||||
public int BelowW1Pct;
|
||||
public string[] BelowItems2;
|
||||
public int BelowW2Pct;
|
||||
public string[] BelowItems3;
|
||||
|
||||
public string Footer;
|
||||
public string DocName;
|
||||
|
||||
[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;
|
||||
|
||||
Template = string.Empty;
|
||||
ParentName = 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;
|
||||
SupressPrinting = false;
|
||||
Header = string.Empty;
|
||||
Footer = string.Empty;
|
||||
DocName = string.Empty;
|
||||
}
|
||||
|
||||
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"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user