ProcessTemplate() public method

Processes the template.
public ProcessTemplate ( string sourceText, string>.IDictionary parameters, bool removeFileHeaders, bool removeXmlComments, bool removeThisPointer ) : TextTransformation
sourceText string The source text.
parameters string>.IDictionary The parameters.
removeFileHeaders bool if set to true [remove file headers].
removeXmlComments bool if set to true [remove XML comments].
removeThisPointer bool if set to true [remove this pointer].
return TextTransformation
Exemplo n.º 1
0
        /// <summary>
        /// Transforms the specified source file.
        /// </summary>
        /// <param name="textTransformationRequest">The text transformation request.</param>
        /// <returns>The Text Transformation.</returns>
        public TextTransformation Transform(TextTransformationRequest textTransformationRequest)
        {
            TraceService.WriteLine("TextTransformationService::Transform sourceFile=" + textTransformationRequest.SourceFile);

            string sourceText = this.GetText(textTransformationRequest.SourceFile);

            TraceService.WriteDebugLine("sourceText=" + sourceText);

            SimpleTextTemplatingEngine engine = new SimpleTextTemplatingEngine();

            TraceService.WriteLine("Before processing template via SimpleTextTemplatingEngine");

            TextTransformation textTransformation = engine.ProcessTemplate(
                sourceText,
                textTransformationRequest.Parameters,
                textTransformationRequest.RemoveFileHeaders,
                textTransformationRequest.RemoveXmlComments,
                textTransformationRequest.RemoveThisPointer);

            TraceService.WriteLine("After processing template via SimpleTextTemplatingEngine = SUCCESS!");

            TraceService.WriteDebugLine("output=" + textTransformation.Output);

            return(textTransformation);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the text output.
        /// </summary>
        /// <param name="sourceText">The source text.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="removeFileHeaders">if set to <c>true</c> [remove file headers].</param>
        /// <param name="removeXmlComments">if set to <c>true</c> [remove XML comments].</param>
        /// <param name="removeThisPointer">if set to <c>true</c> [remove this pointer].</param>
        /// <returns></returns>
        public string GetTextOutput(
            string sourceText,
            IDictionary <string, string> parameters,
            bool removeFileHeaders,
            bool removeXmlComments,
            bool removeThisPointer)
        {
            SimpleTextTemplatingEngine engine = new SimpleTextTemplatingEngine();

            TextTransformation textTransformation = engine.ProcessTemplate(sourceText, parameters, removeFileHeaders, removeXmlComments, removeThisPointer);

            return(textTransformation.Output);
        }
        /// <summary>
        /// Gets the text output.
        /// </summary>
        /// <param name="sourceText">The source text.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="removeFileHeaders">if set to <c>true</c> [remove file headers].</param>
        /// <param name="removeXmlComments">if set to <c>true</c> [remove XML comments].</param>
        /// <param name="removeThisPointer">if set to <c>true</c> [remove this pointer].</param>
        /// <returns></returns>
        public string GetTextOutput(
            string sourceText,
            IDictionary<string, string> parameters,
            bool removeFileHeaders,
            bool removeXmlComments,
            bool removeThisPointer)
        {
            SimpleTextTemplatingEngine engine = new SimpleTextTemplatingEngine();

            TextTransformation textTransformation = engine.ProcessTemplate(sourceText, parameters, removeFileHeaders, removeXmlComments, removeThisPointer);

            return textTransformation.Output;
        }
        /// <summary>
        /// Transforms the specified source file.
        /// </summary>
        /// <param name="textTransformationRequest">The text transformation request.</param>
        /// <returns>The Text Transformation.</returns>
        public TextTransformation Transform(TextTransformationRequest textTransformationRequest)
        {
            TraceService.WriteLine("TextTransformationService::Transform sourceFile=" + textTransformationRequest.SourceFile);

            string sourceText = this.GetText(textTransformationRequest.SourceFile);

            ////TraceService.WriteDebugLine("sourceText=" + sourceText);

            SimpleTextTemplatingEngine engine = new SimpleTextTemplatingEngine();

            TraceService.WriteLine("Before processing template via SimpleTextTemplatingEngine");

            TextTransformation textTransformation = engine.ProcessTemplate(
                                                            sourceText,
                                                            textTransformationRequest.Parameters,
                                                            textTransformationRequest.RemoveFileHeaders,
                                                            textTransformationRequest.RemoveXmlComments,
                                                            textTransformationRequest.RemoveThisPointer);

            TraceService.WriteLine("After processing template via SimpleTextTemplatingEngine = SUCCESS!");

            ////TraceService.WriteDebugLine("output=" + textTransformation.Output);

            return textTransformation;
        }