tbf/TestBenchFramework/BenchControl/ResultsPrinters/Basic/PrinterCfgCtrl.cs
Milan Hanajik 7b6c23f3b2 Printing Purchase orders always in landscape OK. Version 1.3.16.
Printing at the end of cycle can be switched off - Supress printing parameter of ResultsPrinter.Basic component.
2015-04-19 16:49:43 +02:00

75 lines
1.5 KiB
C#

///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
public bool ShowMore { get { return false; } }
PrinterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as PrinterCfg;
Redraw();
}
}
public PrinterCfgCtrl()
{
InitializeComponent();
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
{
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
supressPrintingCheckBox.Checked = config.SupressPrinting;
}
public void Unlock()
{
nameTextBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.SupressPrinting = supressPrintingCheckBox.Checked;
return flags;
}
}
}