Engine.PreprocessTemplate メソッド
実行コンパイルするときに、テンプレートの出力を生成するテンプレートからコードを生成します。
名前空間: Microsoft.VisualStudio.TextTemplating
アセンブリ: Microsoft.VisualStudio.TextTemplating.11.0 (Microsoft.VisualStudio.TextTemplating.11.0.dll 内)
構文
'宣言
Public Function PreprocessTemplate ( _
content As String, _
host As ITextTemplatingEngineHost, _
className As String, _
classNamespace As String, _
<OutAttribute> ByRef language As String, _
<OutAttribute> ByRef references As String() _
) As String
public string PreprocessTemplate(
string content,
ITextTemplatingEngineHost host,
string className,
string classNamespace,
out string language,
out string[] references
)
public:
virtual String^ PreprocessTemplate(
String^ content,
ITextTemplatingEngineHost^ host,
String^ className,
String^ classNamespace,
[OutAttribute] String^% language,
[OutAttribute] array<String^>^% references
) sealed
abstract PreprocessTemplate :
content:string *
host:ITextTemplatingEngineHost *
className:string *
classNamespace:string *
language:string byref *
references:string[] byref -> string
override PreprocessTemplate :
content:string *
host:ITextTemplatingEngineHost *
className:string *
classNamespace:string *
language:string byref *
references:string[] byref -> string
public final function PreprocessTemplate(
content : String,
host : ITextTemplatingEngineHost,
className : String,
classNamespace : String,
language : String,
references : String[]
) : String
パラメーター
- content
型 : System.String
テンプレートの内容。
- host
型 : Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost
テンプレート ホスト。ITextTemplatingEngineHost を実装する必要があります。
- className
型 : System.String
テンプレート コードを受け取るクラスの名前。
- classNamespace
型 : System.String
テンプレート コードが生成される名前空間。
- language
型 : System.String%
生成されるコードの言語。
- references
型 : array<System.String[]%
テンプレートまたはホストによって指定されるアセンブリ。
戻り値
型 : System.String
コンパイルできる文字列。
実装
解説
詳細については、「T4 テキスト テンプレートを使用した実行時テキスト生成」および「カスタム ホストを使用したテキスト テンプレートの処理」を参照してください。
![]() |
---|
Visual Studio内で実行されるパッケージまたは拡張機能を作成する場合は、独自のホストを作成するのではなく、テキスト テンプレート サービスを使用することを検討してください。詳細については、「VS 拡張機能内でのテキスト変換の呼び出し」を参照してください。 |
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。