/// /// Copyright (c) 2018 Sensus Slovensko a.s. /// using System; using System.Net; using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Network.Comet.Ambient { public class AmbientCfg : ComponentCfgBase, IComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); } /// /// Serialized parameters /// public string IPAddress; public int TcpPort; public string SerialNr; /// Private parameterless constructor invoked by all other (public) constructors AmbientCfg() { } public AmbientCfg(string name, IComponentFactory factory) : this() { this.Name = name; this.Factory = factory; IPAddress = "192.168.0.123"; TcpPort = 502; SerialNr = string.Empty; } public string ToString(int i) { return string.Format("Name={0}, IP={1}, Port={2}, s/n={3}", Name, IPAddress, TcpPort, SerialNr); } } }