public static void Write(this TemplateRewriterContext context, List <ScriptNamedArgument> parameters)
        {
            if (parameters == null)
            {
                return;
            }

            for (int i = 0; i < parameters.Count; i++)
            {
                ScriptNamedArgument option = parameters[i];
                context.ExpectSpace();
                context.Write(option);
            }
        }
示例#2
0
        protected override void ProcessArgument(TemplateContext context, ScriptNamedArgument argument)
        {
            _columnsCount = 1;
            if (argument.Name == "cols")
            {
                _columnsCount = context.ToInt(argument.Value.Span, context.Evaluate(argument.Value));
                if (_columnsCount <= 0)
                {
                    _columnsCount = 1;
                }

                return;
            }
            base.ProcessArgument(context, argument);
        }
示例#3
0
 protected virtual void ProcessArgument(TemplateContext context, ScriptNamedArgument argument)
 {
     throw new ScriptRuntimeException(argument.Span, string.Format(RS.InvalidArgInForLoop, argument.Name, this));
 }
        public static void AddParameter(this IScriptNamedArgumentContainer container, ScriptNamedArgument argument)
        {
            if (container.NamedArguments == null)
            {
                container.NamedArguments = new List <ScriptNamedArgument>();
            }

            container.NamedArguments.Add(argument);
        }