Esempio n. 1
0
        public override void Execute(List <ParameterClass> eventParameters)
        {
            CompileResult cr   = null;
            bool          test = true;

            if (_decisionTable != null)
            {
                for (int i = 0; i < _decisionTable.ConditionCount; i++)
                {
                    cr = _decisionTable[i].Condition.DebugCompileUnit;
                    cr.Execute();
                    test = Convert.ToBoolean(cr.ReturnValue);
                    if (test)
                    {
                        if (_decisionTable[i].Actions != null)
                        {
                            for (int k = 0; k < _decisionTable[i].Actions.Count; k++)
                            {
                                _decisionTable[i].Actions[k].Action.Execute(eventParameters);
                            }
                        }
                        break;
                    }
                }
            }
        }
        public override void Execute(List <ParameterClass> eventParameters)
        {
            CompileResult cr = null;
            int           i  = 0;

            while (true)
            {
                if (RepeatCount.ValueType == EnumValueType.ConstantValue)
                {
                    if (i < (int)RepeatCount.ConstantValue.GetValue(ConstObjectPointer.VALUE_Value))
                    {
                        break;
                    }
                }
                else if (RepeatCount.ValueType == EnumValueType.MathExpression)
                {
                    MathNodeRoot r = RepeatCount.MathExpression as MathNodeRoot;
                    if (r == null)
                    {
                        break;
                    }
                    else
                    {
                        cr = r.DebugCompileUnit;
                        cr.Execute();
                        if (!Convert.ToBoolean(cr.ReturnValue))
                        {
                            break;
                        }
                    }
                }
                else
                {
                    IObjectPointer p = RepeatCount.Property;
                    if (p == null)
                    {
                        break;
                    }
                    if (p.ObjectInstance == null)
                    {
                        break;
                    }
                    if (i < (int)(p.ObjectInstance))
                    {
                        break;
                    }
                }
                ExecuteActions(eventParameters);
                i++;
            }
        }
        public override void Execute(List <ParameterClass> eventParameters)
        {
            CompileResult cr   = null;
            bool          test = true;

            if (_logicExpression != null)
            {
                cr = _logicExpression.DebugCompileUnit;
                cr.Execute();
                test = Convert.ToBoolean(cr.ReturnValue);
            }
            if (test)
            {
                while (test)
                {
                    ExecuteActions(eventParameters);
                    if (cr != null)
                    {
                        cr.Execute();
                        test = Convert.ToBoolean(cr.ReturnValue);
                    }
                }
            }
        }