示例#1
0
        internal FlowSourceManager(Engine engine, bool debugMode, FunctionScope globalScope, FunctionScope contextScope, DebugController debugController)
        {
            this.engine          = engine;
            this.debugMode       = debugMode;
            this.contextScope    = contextScope;
            this.globalScope     = globalScope;
            this.debugController = debugController;

            callBackDictionary = new Dictionary <string, List <FlowCallEventHandler> >();
            sources            = new Dictionary <int, FlowSourceObjectBase>();
            flowInfos          = new List <FlowInfo>();
            eventQueue         = new EventQueue();
            currentQueue       = eventQueue;

            scope = new FunctionScope(ScopeType.Default);
            contextScope.AddChild(scope);
            scopes      = new List <FunctionScope>();
            breakPoints = new HashSet <int>();

            Items = new Dictionary <string, object>();
        }
示例#2
0
        public FlowSourceManager Load(Stream stream, bool debugMode, Guid contextGuid, DebugController debugController)
        {
            if (!contexts.TryGetValue(contextGuid, out FunctionScope contextScope))
            {
                contextScope = new FunctionScope(ScopeType.Context);
                contexts.Add(contextGuid, contextScope);
                globalScope.AddChild(contextScope);
            }

            var manager       = new FlowSourceManager(this, debugMode, globalScope, contextScope, debugController);
            var defaultValues = LoadSync(stream, manager);

            manager.Connect(defaultValues);
            manager.Error += e =>
            {
                Error?.Invoke(e);
            };
            managers.Add(manager);

            return(manager);
        }
示例#3
0
 public FlowSourceManager Load(Stream stream, bool debugMode, DebugController debugController)
 {
     return(Load(stream, debugMode, Guid.NewGuid(), debugController));
 }