指定したテキストからテンプレートを作成します。
Protected Function GetTemplateFromText( _
ByVal text As String _) As ITemplate
[C#]
protected ITemplate GetTemplateFromText(stringtext);
[C++]
protected: ITemplate* GetTemplateFromText(String* text);
[JScript]
protected function GetTemplateFromText(
text : String) : ITemplate;
パラメータ
- text
テンプレートの取得元のテキスト。
戻り値
指定したテキストから作成する ITemplate 。
使用例
[Visual Basic] SetTemplateContent メソッドをオーバーライドするコード例を次に示します。このメソッドを呼び出すと、 SetTemplateContent メソッドに渡された templateContent パラメータに関連付けられているテンプレートと等価のテンプレートが、 GetTemplateFromText メソッドによって設定されます。
' Override the SetTemplateContent method to check whether the template
' exists. If it does, set its content to the value already created for it.
'
Public Overrides Sub SetTemplateContent( _
editingFrame As ITemplateEditingFrame, _
templateName As String, _
templateContent As String)
Debug.Assert((editingFrame.Verb.Index = 0))
Debug.Assert(templateName.Equals("ItemTemplate"))
Dim template As ITemplate = Nothing
If Not (templateContent Is Nothing) And templateContent.Length <> 0 Then
template = GetTemplateFromText(templateContent)
End If
CType(Component, TemplatedList).ItemTemplate = template
End Sub
[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
TemplatedControlDesigner クラス | TemplatedControlDesigner メンバ | System.Web.UI.Design 名前空間