2018-10-15 19:33:06 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flowsharp.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Variables : Dictionary<string, object>
|
|
|
|
|
|
{
|
2018-10-16 10:41:12 +00:00
|
|
|
|
public static readonly Variables Empty = new Variables();
|
2018-12-19 08:48:12 +00:00
|
|
|
|
|
|
|
|
|
|
public object GetVariable(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ContainsKey(name) ? this[name] : null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public T GetVariable<T>(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ContainsKey(name) ? (T)this[name] : default(T);
|
|
|
|
|
|
}
|
2018-10-15 19:33:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|