Ejemplo n.º 1
0
 /// <summary>
 /// Renders the template using the specified parameters and returns a string containing the result.
 /// </summary>
 /// <param name="parameters">Render parameters.</param>
 /// <returns>The rendering result as string.</returns>
 public string Render(RenderParameters parameters)
 {
     using (var writer = new StringWriter(parameters.FormatProvider))
     {
         return(this.Render(writer, parameters));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Renders the template using the specified parameters and returns a string containing the result.
        /// </summary>
        /// <param name="writer">Render parameters.</param>
        /// <param name="parameters"></param>
        /// <returns>The rendering result as string.</returns>
        public string Render(TextWriter writer, RenderParameters parameters)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(paramName: nameof(writer));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(paramName: nameof(parameters));
            }

            this.RenderInternal(writer, parameters);
            return(writer.ToString());
        }