Пример #1
0
        internal bool ResolveVariables(ActivityExecutor executor)
        {
            this.substate = Substate.ResolvingVariables;
            bool             flag = true;
            IList <Variable> implementationVariables = this.Activity.ImplementationVariables;
            IList <Variable> runtimeVariables        = this.Activity.RuntimeVariables;
            int count = implementationVariables.Count;
            int num2  = runtimeVariables.Count;

            if ((count > 0) || (num2 > 0))
            {
                using (ActivityContext context = executor.GetResolutionContext(this))
                {
                    for (int i = 0; i < count; i++)
                    {
                        Variable variable = implementationVariables[i];
                        context.Activity = variable.Default;
                        if (!variable.TryPopulateLocation(executor, context))
                        {
                            Location specificLocation = this.environment.GetSpecificLocation(variable.Id);
                            executor.ScheduleExpression(variable.Default, this, this.environment, specificLocation.CreateReference(true));
                            flag = false;
                        }
                    }
                    for (int j = 0; j < num2; j++)
                    {
                        Variable variable2 = runtimeVariables[j];
                        context.Activity = variable2.Default;
                        if (!variable2.TryPopulateLocation(executor, context))
                        {
                            Location location2 = this.environment.GetSpecificLocation(variable2.Id);
                            executor.ScheduleExpression(variable2.Default, this, this.environment, location2.CreateReference(true));
                            flag = false;
                        }
                    }
                }
            }
            return(flag);
        }