Evaluate() private method

private Evaluate ( Template template, Context &context, Hash &registers, IEnumerable &filters ) : void
template Template
context Context
registers Hash
filters IEnumerable
return void
コード例 #1
0
ファイル: Template.cs プロジェクト: jyeohamilton/dotliquid
        /// <summary>
        /// Render takes a hash with local variables.
        ///
        /// if you use the same filters over and over again consider registering them globally
        /// with <tt>Template.register_filter</tt>
        ///
        /// Following options can be passed:
        ///
        /// * <tt>filters</tt> : array with local filters
        /// * <tt>registers</tt> : hash with register variables. Those can be accessed from
        /// filters and tags and might be useful to integrate liquid more with its host application
        /// </summary>
        private void RenderInternal(TextWriter result, RenderParameters parameters)
        {
            if (Root == null)
            {
                return;
            }

            Context            context;
            Hash               registers;
            IEnumerable <Type> filters;

            parameters.Evaluate(this, out context, out registers, out filters);

            if (registers != null)
            {
                Registers.Merge(registers);
            }

            if (filters != null)
            {
                context.AddFilters(filters);
            }

            try
            {
                // Render the nodelist.
                Root.Render(context, result);
            }
            finally
            {
                _errors = context.Errors;
            }
        }
コード例 #2
0
        /// <summary>
        /// Render takes a hash with local variables.
        ///
        /// if you use the same filters over and over again consider registering them globally
        /// with <tt>Template.register_filter</tt>
        ///
        /// Following options can be passed:
        ///
        /// * <tt>filters</tt> : array with local filters
        /// * <tt>registers</tt> : hash with register variables. Those can be accessed from
        /// filters and tags and might be useful to integrate liquid more with its host application
        /// </summary>
        private void RenderInternal(TextWriter result, RenderParameters parameters)
        {
            if (Root == null)
            {
                return;
            }

            Context context;

            parameters.Evaluate(this, out context);

            // Render the nodelist.
            Root.Render(context, result);
        }