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

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

ControlDesigner.GetDesignTimeHtml メソッド (DesignerRegionCollection)

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

コントロール表示する HTML マークアップ取得し現在のコントロール デザイナ領域コレクション設定します

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

Public Overridable Function
 GetDesignTimeHtml ( _
    regions As DesignerRegionCollection _
) As String
Dim instance As ControlDesigner
Dim regions As DesignerRegionCollection
Dim returnValue As String

returnValue = instance.GetDesignTimeHtml(regions)
public virtual string GetDesignTimeHtml (
    DesignerRegionCollection regions
)
public:
virtual String^ GetDesignTimeHtml (
    DesignerRegionCollection^ regions
)
public String GetDesignTimeHtml (
    DesignerRegionCollection regions
)
public function GetDesignTimeHtml (
    regions : DesignerRegionCollection
) : String

パラメータ

regions

関連付けられているコントロールコントロール デザイナ領域コレクション

戻り値
すべてのコントロール デザイナ領域を含む、関連付けられているコントロールデザインHTML マークアップ

解説解説
使用例使用例

DesignerRegionCollection コレクション使用して HTML マークアップ作成する方法次のコード例示します

' Create the regions and design-time markup. Called by the designer
 host.
Public Overrides Function
 GetDesignTimeHtml(ByVal regions As DesignerRegionCollection)
 As String
    ' Create 3 regions: 2 clickable headers and an editable row
    regions.Add(New DesignerRegion(Me, "Header0"))
    regions.Add(New DesignerRegion(Me, "Header1"))

    ' Create an editable region and add it to the regions
    Dim editableRegion As EditableDesignerRegion
 = _
        New EditableDesignerRegion(Me, _
            "Content" & myControl.CurrentView,
 False)
    regions.Add(editableRegion)

    ' Set the highlight for the selected region
    regions(myControl.CurrentView).Highlight = True

    ' Use the base class to render the markup
    Return MyBase.GetDesignTimeHtml()
End Function
// Create the regions and design-time markup. Called by the designer
 host.
public override String GetDesignTimeHtml(DesignerRegionCollection
 regions) {
    // Create 3 regions: 2 clickable headers and an editable row
    regions.Add(new DesignerRegion(this, "Header0"));
    regions.Add(new DesignerRegion(this, "Header1"));

    // Create an editable region and add it to the regions
    EditableDesignerRegion editableRegion = 
        new EditableDesignerRegion(this, 
            "Content" + myControl.CurrentView, false);
    regions.Add(editableRegion);

    // Set the highlight for the selected region
    regions[myControl.CurrentView].Highlight = true;

    // Use the base class to render the markup
    return base.GetDesignTimeHtml();
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ControlDesigner クラス
ControlDesigner メンバ
System.Web.UI.Design 名前空間
GridViewDesigner
その他の技術情報
Web フォームデザインサポート

ControlDesigner.GetDesignTimeHtml メソッド

デザイン時にコントロールを表すために使用する HTML マークアップ取得します
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

ControlDesigner クラス
ControlDesigner メンバ
System.Web.UI.Design 名前空間
GetEmptyDesignTimeHtml
GetErrorDesignTimeHtml
GetDesignTimeHtml
UpdateDesignTimeHtml

その他の技術情報

Web フォームデザインサポート
Web フォームデザインサポート
UpdateDesignTimeHtml Web フォームデザインサポート

ControlDesigner.GetDesignTimeHtml メソッド ()

デザイン時にコントロールを表すために使用する HTML マークアップ取得します

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

Public Overridable Function
 GetDesignTimeHtml As String
Dim instance As ControlDesigner
Dim returnValue As String

returnValue = instance.GetDesignTimeHtml
public virtual string GetDesignTimeHtml ()
public:
virtual String^ GetDesignTimeHtml ()
public String GetDesignTimeHtml ()
public function GetDesignTimeHtml () : String

戻り値
デザイン時にコントロールを表すために使用する HTML マークアップ

解説解説
使用例使用例

カスタム コントロール デザイナGetDesignTimeHtml メソッドオーバーライドする方法次のコード例示します関連付けられているコントロールText プロパティが空の場合GetDesignTimeHtml メソッドは GetEmptyDesignTimeHtml メソッド呼び出します。それ以外場合GetDesignTimeHtml メソッドHyperlink コントロール作成および表示します

Public Overrides Function
 GetDesignTimeHtml() As String
   ' Component is the instance of the component or control that
   ' this designer object is associated with. This property is 
   ' inherited from System.ComponentModel.ComponentDesigner.
   simpleControl = CType(Component, Simple)
   
   If simpleControl.Text.Length > 0 Then
      Dim sw As New StringWriter()
      Dim tw As New HtmlTextWriter(sw)
      
      Dim placeholderLink As New
 HyperLink()
      
      ' Put simpleControl.Text into the link's Text.
      placeholderLink.Text = simpleControl.Text
      placeholderLink.NavigateUrl = simpleControl.Text
      placeholderLink.RenderControl(tw)
      
      Return sw.ToString()
   Else
      Return GetEmptyDesignTimeHtml()
   End If
End Function
public override string GetDesignTimeHtml()
{
    if (simpleControl.Text.Length > 0)
    {
        string spec = "<a href='{0}.aspx'>{0}</a>";
        return String.Format(spec, simpleControl.Text);
    }
    else
        return GetEmptyDesignTimeHtml();
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ControlDesigner クラス
ControlDesigner メンバ
System.Web.UI.Design 名前空間
GetEmptyDesignTimeHtml
GetErrorDesignTimeHtml
GetDesignTimeHtml
UpdateDesignTimeHtml
その他の技術情報
Web フォームデザインサポート
Web フォームデザインサポート



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

辞書ショートカット

カテゴリ一覧

すべての辞書の索引



Weblioのサービス

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



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

   

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



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

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

©2024 GRAS Group, Inc.RSS