using System; using System.Windows.Forms; using log4net; using TBF.BenchControl.Generic; namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod { public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl { static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl)); TestMethodCfg config; public IComponentCfg Config { get { return config as IComponentCfg; } set { config = value as TestMethodCfg; Redraw(); } } public TestMethodCfgCtrl() { InitializeComponent(); } private void EntryFormCfgCtrl_Load(object sender, EventArgs e) { Redraw(); } void Redraw() { if (config == null) return; /// Control was not loaded, settings were not changed classNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; } public void Unlock() { nameTextBox.Enabled = true; } public CfgVerifyFlags VerifyCfg(ref string message) { CfgVerifyFlags flags = CfgVerifyFlags.None; return flags; } public void UpdateCfg() { if (config == null) return; /// Control was not loaded, settings were not changed config.Name = nameTextBox.Text; } } }