ITextTemplating.PreprocessTemplate Method
Visual Studio 2010
Process a text template to produce source code that can be invoked at run time.
Assembly: Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (in Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll)
string PreprocessTemplate( string inputFile, string content, ITextTemplatingCallback callback, string className, string classNamespace, out string[] references )
Parameters
- inputFile
- Type: System.String
The filename of the template to process, for reference in error reports. Optional.
- content
- Type: System.String
The text of the template
- callback
- Type: Microsoft.VisualStudio.TextTemplating.VSHost.ITextTemplatingCallback
You can supply an object that will be called if errors are reported. Optional.
- className
- Type: System.String
The name of the class to generate
- classNamespace
- Type: System.String
The namespace within which to generate the class
- references
- Type: System.String[]%
The set of assemblies referenced by the template in assembly directives. For more information, see T4 Assembly Directive
Return Value
Type: System.StringSource code that can be compiled and run to produce the output defined by the template.
This method produces source code in C# or Visual Basic that can be compiled and run to produce the output defined by the template. Typically, you would incorporate the source code in an application.
For more information, see Invoking Text Transformation in a VS Extension and Run-Time Text Generation by using Preprocessed T4 Text Templates.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.