XmlSerializers created by XmlSerializer.FromType(new[] {typeof(...)})[0]; This prevents throwing an exception => better debugging.
This commit is contained in:
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.Network.Adapter
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(NetadapterCfg), component, this);
|
||||
return ComponentCfgBase.CreateFromDbEntity(NetadapterCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Network.Adapter
|
||||
{
|
||||
public class NetadapterCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(NetadapterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new NetadapterCfgCtrl(); }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user