Export (0) Print
Expand All

Microsoft.VisualStudio.TextTemplating.VSHost Namespace

This namespace contains types concerned with the text template transformation service in Visual Studio.

To invoke text template transformation in a Visual Studio extension, get the STextTemplating service, cast it to ITextTemplating, and then use the methods there:

ITextTemplating tt = ServiceProvider.GetService(typeof(STextTemplating)) as ITextTemplating;
tt.ProcessTemplate(templatePath, templateContent, errorCallback, vsProjectHierarchy);

For more detailed control, you can use ITextTemplatingComponents:

ITextTemplatingComponents ttc = 
    ServiceProvider.GetService(typeof(STextTemplating)) as ITextTemplatingComponents;

For more information, see Invoking Text Transformation in a VS Extension.

  ClassDescription
Public classBaseCodeGeneratorA managed wrapper for VS's concept of an IVsSingleFileGenerator which is a custom tool invoked during the build which can take any file as an input and provide a compilable code file as output.
Public classBaseCodeGeneratorWithSiteThis class exists to be co-created in a preprocessor build step.
Public classBaseTemplatedCodeGeneratorText Templating Code Generator
Public classCommandIdsCommandIDs for the Text Templating Orchestrator package.
Public classCompositionServicesClass to standardize usage of MEF within T4.
Public classModelingTextTransformationUse this base class for text transformations from domain-specific language models.
Public classOrchestratorOptionsAutomationProvides storage for the settings that are displayed in the Text Templating page in the Tools Options dialog.
Public classOrchestratorOptionsPageThe page in the Visual Studio Tools>Options dialog in which users can set Text Templating options.
Public classProvideCodeGeneratorAttributeApply this attribute to the package class in a Visual Studio extension that provides a custom tool.
Public classProvideCodeGeneratorExtensionAttributeApply this attribute to a package class of a package that provides a code generator for a specific file extension.
Public classProvideDirectiveProcessorAttributeApply this attribute to the package class of a package that defines a text template directive processor.
Public classProvideIncludeFolderAttributeRegisters a folder to search for text template include files. Apply this attribute to a package class if you want the include folder to be registered when the package is installed.
Public classTemplatedCodeGeneratorProcesses and runs a text template.Only a single generator is needed for any style of template as the custom code is handled with directive providers.
Public classTemplatedPreprocessorCreates source code that can be compiled and run to generate the output defined by the text template. Typically the code generated by these run-time templates is used as part of an application.Only a single generator is needed for any style of template as the custom code is handled with directive providers.

  InterfaceDescription
Public interfaceITextTemplatingThe principal interface of the text template transformation service in Visual Studio, STextTemplating.
Public interfaceITextTemplatingCallbackImplement this interface if you are using the STextTemplating service and you want to be informed of errors when a template is processed. You can also get the file extension and output encoding requested by the template.
Public interfaceITextTemplatingComponentsCast the STextTemplatingservice to this interface to gain access to the components of the text templating service. Use this interface instead of ITextTemplating for advanced scenarios.
Public interfaceIVsGeneratorProgress Obsolete.
Public interfaceIVsSingleFileGenerator Obsolete.
Public interfaceSTextTemplatingThe text template transformation service in Visual Studio.

Community Additions

ADD
Show:
© 2014 Microsoft