Language

ThemeableAttribute(Boolean) コンストラクター

定義

指定したブール値を使用して、テーマとコントロール スキンの影響を受ける型またはメンバーを属性が表しているかどうかを判断して、 ThemeableAttribute クラスの新しいインスタンスを初期化します。

public:
 ThemeableAttribute(bool themeable);
public ThemeableAttribute(bool themeable);
new System.Web.UI.ThemeableAttribute : bool -> System.Web.UI.ThemeableAttribute
Public Sub New (themeable As Boolean)

パラメーター

themeable
Boolean

true テーマの影響を受ける可能性がある型またはメンバーを表す ThemeableAttribute を初期化する場合は。それ以外の場合は false。

例

次のコード例は、コントロールのメンバーに ThemeableAttribute 属性を適用する方法を示しています。 この例では、 ThemeableAttribute がデータ バインド コントロールに適用され、 false が ThemeableAttribute コンストラクターに渡され、 DataSourceID メンバーにテーマを適用できないことを示します。 (コンストラクターにfalseを渡すと、ThemeableAttribute フィールドと同等のNo インスタンスが生成されます)。

namespace Samples.AspNet.CS.Controls {
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class SomeDataBoundControl : DataBoundControl
    {
        // Implementation of a custom data source control.
        
        [Themeable(false) ]
        [IDReferenceProperty()]
        public override string DataSourceID {
            get {
                return base.DataSourceID;
            }
            set {
                base.DataSourceID = value;
            }
        }
    }
}
Imports System.Web.UI
Imports System.Web.UI.WebControls

Public Class SomeDataBoundControl
    Inherits DataBoundControl

    ' Implementation of a custom data source control.
    
    <Themeable(False)> _
    <IDReferenceProperty()>  _
    Public Overrides Property DataSourceID() As String 
        Get
            Return MyBase.DataSourceID
        End Get
        Set
            MyBase.DataSourceID = value
        End Set
    End Property
    
End Class

注釈

このコンストラクターに true を渡すことは、 Yes フィールドを使用することと同じですが、 false を渡すことは、 No フィールドの使用と同じです。

適用対象