ITextTemplatingEngineHost.TemplateFile Property

Gets the path and file name of the text template that is being processed.

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating (in Microsoft.VisualStudio.TextTemplating.dll)

Syntax

'Declaration
ReadOnly Property TemplateFile As String
'Usage
Dim instance As ITextTemplatingEngineHost 
Dim value As String 

value = instance.TemplateFile
string TemplateFile { get; }
property String^ TemplateFile {
    String^ get ();
}
function get TemplateFile () : String

Property Value

Type: System.String
A String that contains the path and file name of the text template that is being processed.

Examples

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.

string candidate = Path.Combine(Path.GetDirectoryName(this.TemplateFile), fileName);
if (File.Exists(candidate))
{
       return candidate;
}
Dim candidate As String = Path.Combine(Path.GetDirectoryName(Me.TemplateFile), fileName)
If File.Exists(candidate) Then
       Return candidate
End If

.NET Framework Security

See Also

Reference

ITextTemplatingEngineHost Interface

ITextTemplatingEngineHost Members

Microsoft.VisualStudio.TextTemplating Namespace

Other Resources

Creating Custom Text Template Hosts

Walkthrough: Creating a Custom Text Template Host

Generating Artifacts By Using Text Templates