Aracılığıyla paylaş


IDReferencePropertyAttribute Oluşturucular

Tanım

IDReferencePropertyAttribute sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

IDReferencePropertyAttribute()

IDReferencePropertyAttribute sınıfının yeni bir örneğini başlatır.

IDReferencePropertyAttribute(Type)

Belirtilen türü kullanarak sınıfının yeni bir örneğini IDReferencePropertyAttribute başlatır.

IDReferencePropertyAttribute()

IDReferencePropertyAttribute sınıfının yeni bir örneğini başlatır.

public:
 IDReferencePropertyAttribute();
public IDReferencePropertyAttribute ();
Public Sub New ()

Örnekler

Aşağıdaki kod örneği, özniteliğin bir dize olarak IDReferencePropertyAttribute değerlendirilen bir özelliğe nasıl uygulandığını gösterir. Bu örnekte, DataSourceID üye çalışma zamanında bir veri kaynağı denetimi tanımlar. parametresiz oluşturucu ReferencedControlType kullanılarak özelliği varsayılan değerine Controlayarlanır.

// This class implements a custom data source control.
public class SomeDataBoundControl : DataBoundControl
{
    [ IDReferencePropertyAttribute() ]        
    new public string DataSourceID {
        get {
            return base.DataSourceID;
        }
        set {
            base.DataSourceID = value;
        }
    }
}
' This class implements a custom data source control.
Public Class SomeDataBoundControl
    Inherits DataBoundControl
    
    <IDReferencePropertyAttribute()>  _
    Public Shadows Property DataSourceID() As String 
        Get
            Return MyBase.DataSourceID
        End Get
        Set
            MyBase.DataSourceID = value
        End Set
    End Property
    
End Class

Açıklamalar

Bu oluşturucuyu ReferencedControlType çağırdığınızda, özelliği varsayılan değeri olan olarak ayarlanır Control.

Ayrıca bkz.

Şunlara uygulanır

IDReferencePropertyAttribute(Type)

Belirtilen türü kullanarak sınıfının yeni bir örneğini IDReferencePropertyAttribute başlatır.

public:
 IDReferencePropertyAttribute(Type ^ referencedControlType);
public IDReferencePropertyAttribute (Type referencedControlType);
new System.Web.UI.IDReferencePropertyAttribute : Type -> System.Web.UI.IDReferencePropertyAttribute
Public Sub New (referencedControlType As Type)

Parametreler

referencedControlType
Type

Type uygulandığı özellik IDReferencePropertyAttribute tarafından temsil edilen denetimin türünü belirten bir.

Örnekler

Aşağıdaki kod örneği, özniteliğin bir dize olarak IDReferencePropertyAttribute değerlendirilen bir özelliğe nasıl uygulandığını gösterir. Bu örnekte, DataSourceID üye bir veri kaynağı denetimi tanımlar ve bu nedenle türünü belirtir DataSourceControl .

// This class implements a custom data source control.
public class SomeDataBoundControl : DataBoundControl
{   
    [ IDReferencePropertyAttribute(typeof(DataSourceControl)) ]        
    new public string DataSourceID {
        get {
            return base.DataSourceID;
        }
        set {
            base.DataSourceID = value;
        }
    }
}
' This class implements a custom data source control.
Public Class SomeDataBoundControl
    Inherits DataBoundControl
    
    <IDReferencePropertyAttribute(GetType(DataSourceControl))>  _
    Public Shadows Property DataSourceID() As String 
        Get
            Return MyBase.DataSourceID
        End Get
        Set
            MyBase.DataSourceID = value
        End Set
    End Property
    
End Class

Ayrıca bkz.

Şunlara uygulanır