39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
///
|
|
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
|
///
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.Output.DataStorage.UniDataStorageWriter
|
|
{
|
|
/// <summary>
|
|
/// Factory component 'UniDataStorageWriter' implements more storing modules
|
|
/// Modules:
|
|
/// </summary>
|
|
public class Factory : IComponentFactory
|
|
{
|
|
public string ClassName { get { return GetType().Namespace.Substring(8); } } /// For backward compatibility
|
|
public override string ToString() { return ClassName; }
|
|
|
|
public IComponent DummyComponent() { return new Writer(new WriterCfg("UniDataStorageWriter", this)); }
|
|
|
|
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components)
|
|
{
|
|
WriterCfg WriterCfg = cfg as WriterCfg;
|
|
if (WriterCfg == null)
|
|
throw new ArgumentException("Invalid config for UniDataStorageWriter");
|
|
|
|
return new Writer(WriterCfg);
|
|
}
|
|
|
|
public IComponentCfg DefaultConfig() { return new WriterCfg("UniDataStorageWriter", this); }
|
|
|
|
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
|
{
|
|
return ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
|
|
}
|
|
}
|
|
}
|