tbf/TBF/BenchControl/Output/FileWriters/XmlBatch/Factory.cs

28 lines
974 B
C#
Raw Normal View History

///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
public class FactorySingle : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(17) + ".Single"; } }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.XmlBatch", this, Config.Entities.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = Config.Entities.MetersKind.Single;
return cfg;
}
}
}