The following code example shows a possible implementation for a custom host. This code example is part of a larger example that is provided for the ITextTemplatingEngineHost interface.
//the host can provide a default by setting the value of the field here
private string fileExtensionValue = ".txt";
public string FileExtension
{
get { return fileExtensionValue; }
}
public void SetFileExtension(string extension)
{
//the parameter extension has a '.' in front of it already
//--------------------------------------------------------
fileExtensionValue = extension;
}
'the host can provide a default by setting the value of the field here
Private fileExtensionValue As String = ".txt"
Public ReadOnly Property FileExtension() As String
Get
Return fileExtensionValue
End Get
End Property
Public Sub SetFileExtension(ByVal extension As String) Implements Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.SetFileExtension
'the parameter extension has a '.' in front of it already
'--------------------------------------------------------
fileExtensionValue = extension
End Sub