示例#1
0
        internal protected Variable GetSharedVariable(string key, out Task task)
        {
            Variable variable;

            if (sharedVariables != null)
            {
                variable = sharedVariables.Get(key);
            }
            else
            {
                variable = null;
            }

            if (variable != null)  // Found in current task
            {
                task = this;
            }
            else if (ParentTask != null)   // Try find in ancestor nodes
            {
                variable = ParentTask.GetSharedVariable(key, out task);
            }
            else
            {
                task = null;
            }

            return(variable);
        }
示例#2
0
        internal protected Variable GetSharedVariableFromParent(string key, out Task task)
        {
            if (ParentTask == null)
            {
                throw new InvalidOperationException("No parent");
            }

            return(ParentTask.GetSharedVariable(key, out task));
        }