tbf/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfg.cs
2016-02-24 22:55:40 +01:00

58 lines
1.5 KiB
C#

///
/// Copyright (c) 2013-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.Basic
{
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Printer(this); }
public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); }
///
/// Serialized parameters
///
public PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public bool SupressPrinting; /// Bypass printing when true
/// Private parameterless constructor invoked by all other (public) constructors
PrinterCfg()
{
Name = "BasicResultsPrinter";
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
LeftMargin = 100;
SupressPrinting = false;
}
public PrinterCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
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"
);
}
}
}