Html32TextWriter.SupportsBold プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Html32TextWriter.SupportsBold プロパティの意味・解説 

Html32TextWriter.SupportsBold プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

要求元のデバイス太字HTML テキストサポートしているかどうかを示すブール値を取得または設定しますSupportsBold プロパティ使用して太字テキスト条件付きで Html32TextWriter 出力ストリーム出力します

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

Dim instance As Html32TextWriter
Dim value As Boolean

value = instance.SupportsBold

instance.SupportsBold = value
public bool SupportsBold { get;
 set; }
public:
property bool SupportsBold {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_SupportsBold ()

/** @property */
public void set_SupportsBold (boolean value)
public function get SupportsBold
 () : boolean

public function set SupportsBold
 (value : boolean)

プロパティ
要求元のデバイス太字テキストサポートしている場合trueそれ以外場合false既定値true です。

使用例使用例

RenderBeforeContent メソッドと RenderAfterContent メソッドオーバーライドする方法次のコード例示します。各オーバーライドは、現在レンダリングしているのが Label 要素であるかどうか確認し次にSupportsBold メソッド使用して要求元のデバイス太字表示できるかどうか確認しますデバイス太字サポートしている場合RenderBeforeContent メソッドb 要素開始タグ書き込みRenderAfterContent メソッドはその終了タグ書き込みますデバイス太字サポートしてない場合RenderBeforeContent メソッドcolor 属性が赤の 16 進値に設定されFont 要素開始タグ書き込みRenderAfterContent メソッドはその終了タグ書き込みます

このコード例は、Html32TextWriter クラストピック取り上げているコード例一部分です。

' Override the RenderBeforeContent method to render
' styles before rendering the content of a <th> element.
Protected Overrides Function
 RenderBeforeContent() As String
    ' Check the TagKey property. If its value is
    ' HtmlTextWriterTag.TH, check the value of the 
    ' SupportsBold property. If true, return the
    ' opening tag of a <b> element; otherwise, render
    ' the opening tag of a <font> element with a color
    ' attribute set to the hexadecimal value for red.
    If TagKey = HtmlTextWriterTag.Th Then
        If (SupportsBold) Then
            Return "<b>"
        Else
            Return "<font color=""FF0000"">"
        End If
    End If

    ' Check whether the element being rendered
    ' is an <H4> element. If it is, check the 
    ' value of the SupportsItalic property.
    ' If true, render the opening tag of the <i> element
    ' prior to the <H4> element's content; otherwise, 
    ' render the opening tag of a <font> element 
    ' with a color attribute set to the hexadecimal
    ' value for navy blue.
    If TagKey = HtmlTextWriterTag.H4 Then
        If (SupportsItalic) Then
            Return "<i>"
        Else
            Return "<font color=""000080"">"
        End If
    End If
    ' Call the base method.
    Return MyBase.RenderBeforeContent()
End Function
// Override the RenderBeforeContent method to render
// styles before rendering the content of a <th> element.
protected override string RenderBeforeContent()
{
    // Check the TagKey property. If its value is
    // HtmlTextWriterTag.TH, check the value of the 
    // SupportsBold property. If true, return the
    // opening tag of a <b> element; otherwise, render
    // the opening tag of a <font> element with a color
    // attribute set to the hexadecimal value for red.
    if (TagKey == HtmlTextWriterTag.Th)
    {
        if (SupportsBold)
            return "<b>";
        else
            return "<font color=\"FF0000\">";
    }

    // Check whether the element being rendered
    // is an <H4> element. If it is, check the 
    // value of the SupportsItalic property.
    // If true, render the opening tag of the <i> element
    // prior to the <H4> element's content; otherwise, 
    // render the opening tag of a <font> element 
    // with a color attribute set to the hexadecimal
    // value for navy blue.
    if (TagKey == HtmlTextWriterTag.H4)
    {
        if (SupportsItalic)
            return "<i>";
        else
            return "<font color=\"000080\">";
    }
    // Call the base method.
    return base.RenderBeforeContent();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Html32TextWriter クラス
Html32TextWriter メンバ
System.Web.UI 名前空間
RenderBeforeContent
RenderAfterContent
SupportsItalic



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

辞書ショートカット

すべての辞書の索引

Html32TextWriter.SupportsBold プロパティのお隣キーワード
検索ランキング

   

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



Html32TextWriter.SupportsBold プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS