Ejemplo n.º 1
0
        private void InternalAppendScript(StringBuilder builder, ScriptOptions options)
        {
            if (_parent != null)
            {
                _parent.InternalAppendScript(builder, options);

                builder.Append(" else ");
            }

            if (Condition == null)
            {
                throw new InvalidOperationException("Condition cannot be null.");
            }

            builder.Append("if(");
            Condition.AppendScript(builder, options, false);
            builder.Append(")");

            Statement then = ThenStatement ?? new EmptyStatement();

            then.AppendScript(builder, options, false);
            then.AppendRequiredTerminator(builder);
        }