ThemeableAttribute(Boolean) Costruttore

Definizione

Inizializza una nuova istanza della classe ThemeableAttribute utilizzando il valore booleano specificato per determinare se l'attributo rappresenta un tipo o un membro che supporta temi e interfacce del controllo.

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

Parametri

themeable
Boolean

true per inizializzare l'oggetto ThemeableAttribute in modo da rappresentare un tipo o un membro che supporta i temi, altrimenti false.

Esempio

Nell'esempio di codice seguente viene illustrato come applicare l'attributo ThemeableAttribute a un membro di un controllo . In questo esempio, ThemeableAttribute viene applicato a un controllo associato a dati e false viene passato al ThemeableAttribute costruttore, a indicare che il DataSourceID membro non può avere temi applicati. Passando false al costruttore viene restituita un'istanza ThemeableAttribute equivalente al No campo .

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

Commenti

true Il passaggio a questo costruttore equivale all'uso del campo , mentre il Yes passaggio false equivale all'uso del No campo .

Si applica a