예제 #1
0
        public override string Evaluate(Context context)
        {
            StringBuilder result = new StringBuilder();

            try
            {
                if (Cond.Evaluate(context))
                {
                    foreach (var unit in Units)
                    {
                        result.Append(unit.Evaluate(context));
                    }
                }
                else
                {
                    foreach (var eUnit in ElseUnits)
                    {
                        if (eUnit.GetResultOfCondition(context))
                        {
                            result.Append(eUnit.Evaluate(context));

                            break;
                        }
                    }
                }
            }
            catch (BreakException ex)
            {
                ex.AddToResult(result.ToString());
                throw;
            }
            return(result.ToString());
        }