This documentation is archived and is not being maintained.
ITextTemplatingEngineHost::GetHostOption Method
Visual Studio 2012
Called by the Engine to ask for the value of a specified option. Return null if you do not know.
Assembly: Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (in Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll)
Currently, the only option invoked by the Engine is CacheAssemblies. It returns true if assemblies are retained between successive text template processing runs. The standard hosts return true, unless the string value CacheAssemblies="false" is set in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\version\TextTemplating\.
The following code example shows a possible implementation for a custom host. This code example is part of a larger example. For the complete example, see Walkthrough: Creating a Custom Text Template Host.
public object GetHostOption(string optionName) { object returnObject; switch (optionName) { case "CacheAssemblies": returnObject = true; break; default: returnObject = null; break; } return returnObject; }
- 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.
Show: