ITextTemplatingEngineHost.TemplateFile プロパティ

処理されるテキスト テンプレートのパスとファイル名を取得します。

名前空間:  Microsoft.VisualStudio.TextTemplating
アセンブリ:  Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll 内)

構文

'宣言
ReadOnly Property TemplateFile As String
string TemplateFile { get; }
property String^ TemplateFile {
    String^ get ();
}
abstract TemplateFile : string
function get TemplateFile () : String

プロパティ値

型 : System.String
処理されるテキスト テンプレートのパスとファイル名を表す String

カスタム ホストを実装するコード例を次に示します。ここに示すコード例は、より長い例の一部です。コード例全体については、「チュートリアル: カスタム テキスト テンプレート ホストの作成」を参照してください。

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 セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

ITextTemplatingEngineHost インターフェイス

Microsoft.VisualStudio.TextTemplating 名前空間

その他の技術情報

カスタム ホストを使用したテキスト テンプレートの処理

チュートリアル: カスタム テキスト テンプレート ホストの作成

コード生成と T4 テキスト テンプレート