using System.Collections.Concurrent;
|
using System.Collections.Generic;
|
|
namespace OpenTap.Addin
|
{
|
public interface IStationGlobalsManager
|
{
|
IList<TestVariable> ReadFromLocal();
|
|
ConcurrentDictionary<string, RuntimeVariable> ToRuntime(TestPlanRun run);
|
|
bool WriteToLocal(IEnumerable<TestVariable> datas);
|
void SetValue(string key, object value);
|
T GetValue<T>(string key);
|
}
|
|
public class StationGlobalsManager
|
{
|
private static IStationGlobalsManager instance;
|
public static void Register(IStationGlobalsManager manager)
|
{
|
if (instance == null)
|
{
|
instance = manager;
|
}
|
}
|
|
public static T GetValue<T>(string key)
|
{
|
return instance.GetValue<T>(key);
|
}
|
|
public static void SetValue(string key, object value)
|
{
|
instance.SetValue(key, value);
|
}
|
|
public static IEnumerable<TestVariable> ReadFromLocal()
|
{
|
return instance.ReadFromLocal();
|
}
|
|
public static ConcurrentDictionary<string, RuntimeVariable> ToRuntime(TestPlanRun run)
|
{
|
return instance.ToRuntime(run);
|
}
|
|
public static bool WriteToLocal(IEnumerable<TestVariable> datas)
|
{
|
return instance.WriteToLocal(datas);
|
}
|
}
|
}
|