2025-01-17 16:39:36 +05:00
|
|
|
|
namespace DD.Persistence.Client;
|
|
|
|
|
internal class SetpointConfigStorage : ISetpointConfigStorage
|
|
|
|
|
{
|
|
|
|
|
private readonly Dictionary<Guid, Type> setpointTypeConfigs;
|
|
|
|
|
|
|
|
|
|
public SetpointConfigStorage(Dictionary<Guid, Type>? setpointTypeConfigs)
|
|
|
|
|
{
|
|
|
|
|
this.setpointTypeConfigs = setpointTypeConfigs?? new Dictionary<Guid, Type>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool TryGetType(Guid id, out Type type)
|
|
|
|
|
{
|
|
|
|
|
return setpointTypeConfigs.TryGetValue(id, out type);
|
|
|
|
|
}
|
2025-01-20 14:01:46 +05:00
|
|
|
|
|
|
|
|
|
public void AddOrReplace(Guid id, Type type)
|
|
|
|
|
{
|
|
|
|
|
setpointTypeConfigs[id] = type;
|
|
|
|
|
}
|
2025-01-17 16:39:36 +05:00
|
|
|
|
}
|