ControlDesigner.SetEditableDesignerRegionContent メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ControlDesigner.SetEditableDesignerRegionContent メソッドの意味・解説 

ControlDesigner.SetEditableDesignerRegionContent メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

デザイン時にコントロール編集可能領域内容指定します

名前空間: System.Web.UI.Design
アセンブリ: System.Design (system.design.dll 内)
構文構文

Public Overridable Sub SetEditableDesignerRegionContent
 ( _
    region As EditableDesignerRegion, _
    content As String _
)
Dim instance As ControlDesigner
Dim region As EditableDesignerRegion
Dim content As String

instance.SetEditableDesignerRegionContent(region, content)
public virtual void SetEditableDesignerRegionContent
 (
    EditableDesignerRegion region,
    string content
)
public:
virtual void SetEditableDesignerRegionContent (
    EditableDesignerRegion^ region, 
    String^ content
)
public void SetEditableDesignerRegionContent
 (
    EditableDesignerRegion region, 
    String content
)
public function SetEditableDesignerRegionContent
 (
    region : EditableDesignerRegion, 
    content : String
)

パラメータ

region

コントロール含まれる編集可能なデザイン領域

content

編集可能なデザイン領域割り当てる内容

解説解説

ControlDesigner クラスから派生したクラスでは、デザイン サーフェイスでの領域ベース編集サポートでき、SetEditableDesignerRegionContentオーバーライドして指定した領域内容設定できます

使用例使用例

デザイン ホストへの参照取得し、その参照使用してcontent を ITemplate インターフェイスインスタンス変更しITemplate適切なビュー割り当てる ControlParser オブジェクト作成する方法コード例次に示します

' Create a template from the content string and put it 
' in the selected view. Called by the designer host?
Public Overrides Sub SetEditableDesignerRegionContent(ByVal
 region As EditableDesignerRegion, ByVal content
 As String)
    If IsNothing(content) Then
        Return
    End If

    ' Get a reference to the designer host
    Dim host As IDesignerHost = CType(Component.Site.GetService(GetType(IDesignerHost)),
 IDesignerHost)
    If Not IsNothing(host) Then
        ' Create a template from the content string
        Dim template As ITemplate = ControlParser.ParseTemplate(host,
 content)

        If Not IsNothing(template) Then

            ' Determine which region should get the template
            If region.Name.EndsWith("0")
 Then
                myControl.View1 = template
            ElseIf region.Name.EndsWith("1")
 Then
                myControl.View2 = template
            End If

        End If
    End If
End Sub
// Create a template from the content string and  
// put it in the selected view.
public override void SetEditableDesignerRegionContent(EditableDesignerRegion
 region, string content)
{
    if (content == null)
        return;

    // Get a reference to the designer host
    IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
    if (host != null)
    {
        // Create a template from the content string
        ITemplate template = ControlParser.ParseTemplate(host, content);

        if (template != null)
        {
            // Determine which region should get the template
            // Either 'Content0' or 'Content1'
            if (region.Name.EndsWith("0"))
                myControl.View1 = template;
            else if (region.Name.EndsWith("1"))
                myControl.View2 = template;
        }
    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ControlDesigner クラス
ControlDesigner メンバ
System.Web.UI.Design 名前空間
GetEditableDesignerRegionContent
EditableDesignerRegion
その他の技術情報
Web フォームデザインサポート



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ControlDesigner.SetEditableDesignerRegionContent メソッド」の関連用語

ControlDesigner.SetEditableDesignerRegionContent メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ControlDesigner.SetEditableDesignerRegionContent メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS