public override DynamicObject Store()
        {
            var d = new DynamicObject();

            d.Set("Ref", Ref);
            d.Set("Type", nameof(Sequence));
            var list = new List <DynamicObject>();

            foreach (var s in Steps)
            {
                list.Add(s.Store());
            }
            d.Set("Steps", list);
            return(d);
        }
        public override void Compile(Compiler compiler)
        {
            var type  = GetType();
            var props = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
            var dobj  = new DynamicObject();

            dobj.Set("$type", type.FullName);
            foreach (var p in props)
            {
                dobj.Set(p.Name, p.GetValue(this));
            }
            var ps = JsonConvert.SerializeObject(dobj.Root);

            compiler.StartActivity(this);
            compiler.Emit(OpCode.Execute, ps);
            if (IsWaitable)
            {
                compiler.Emit(OpCode.Wait);
                compiler.Emit(OpCode.Continue, ps);
            }
            compiler.EndActivity(this);
        }
        public void Store(String refer, String varName, Object value)
        {
            if (_storage == null)
            {
                return;
            }
            if (!_storage.TryGetValue(refer, out Object val))
            {
                _storage.Set(refer, new ExpandoObject());
            }
            DynamicObject dobj = _storage.Get <ExpandoObject>(refer);

            dobj.Set(varName, value);
        }