XmlSerializers created by XmlSerializer.FromType(new[] {typeof(...)})[0]; This prevents throwing an exception => better debugging.

This commit is contained in:
Milan Hanajik
2017-06-22 21:37:05 +02:00
parent 7ad8c986d7
commit 17f6f7c3be
193 changed files with 450 additions and 182 deletions
@@ -12,6 +12,9 @@ namespace TBF.BenchControl.TestMethods.LiveStream
{
public class Cfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Cfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new CfgCtrl(); }
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.TestMethods.LiveStream
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(Cfg), component, this);
return ComponentCfgBase.CreateFromDbEntity(Cfg.Serializer, component, this);
}
}
}