IDReferencePropertyAttribute Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da IDReferencePropertyAttribute classe.
Sobrecargas
| Name | Description |
|---|---|
| IDReferencePropertyAttribute() |
Inicializa uma nova instância da IDReferencePropertyAttribute classe. |
| IDReferencePropertyAttribute(Type) |
Inicializa uma nova instância da IDReferencePropertyAttribute classe usando o tipo especificado. |
IDReferencePropertyAttribute()
Inicializa uma nova instância da IDReferencePropertyAttribute classe.
public:
IDReferencePropertyAttribute();
public IDReferencePropertyAttribute();
Public Sub New ()
Exemplos
O exemplo de código seguinte demonstra como o IDReferencePropertyAttribute atributo é aplicado a uma propriedade que se avalia a uma cadeia. Neste exemplo, o DataSourceID membro identifica um controlo de fonte de dados em tempo de execução. Ao usar o construtor sem parâmetros, a ReferencedControlType propriedade é definida para o valor padrão, Control.
// 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
Observações
Quando se chama este construtor, a ReferencedControlType propriedade é definida como Control, que é o seu valor padrão.
Ver também
Aplica-se a
IDReferencePropertyAttribute(Type)
Inicializa uma nova instância da IDReferencePropertyAttribute classe usando o tipo especificado.
public:
IDReferencePropertyAttribute(Type ^ referencedControlType);
public IDReferencePropertyAttribute(Type referencedControlType);
new System.Web.UI.IDReferencePropertyAttribute : Type -> System.Web.UI.IDReferencePropertyAttribute
Public Sub New (referencedControlType As Type)
Parâmetros
- referencedControlType
- Type
A Type que especifica o tipo de controlo representado pela propriedade à qual o IDReferencePropertyAttribute é aplicado.
Exemplos
O exemplo de código seguinte demonstra como o IDReferencePropertyAttribute atributo é aplicado a uma propriedade que se avalia a uma cadeia. Neste exemplo, o DataSourceID membro identifica um controlo de fonte de dados e, por isso, especifica o DataSourceControl tipo.
// 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