IDReferencePropertyAttribute Classe
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Definisce un attributo applicato alle proprietà che contengono riferimenti ID. La classe non può essere ereditata.
public ref class IDReferencePropertyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Property)]
public sealed class IDReferencePropertyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Property)>]
type IDReferencePropertyAttribute = class
inherit Attribute
Public NotInheritable Class IDReferencePropertyAttribute
Inherits Attribute
- Ereditarietà
- Attributi
Esempio
Nell'esempio di codice seguente viene illustrato come l'attributo IDReferencePropertyAttribute viene applicato a una proprietà che restituisce una stringa. In questo esempio, il DataSourceID membro identifica un controllo origine dati e quindi specifica il 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
Commenti
La IDReferencePropertyAttribute classe viene applicata alle proprietà che contengono riferimenti ID. ContentPlaceHolderID è un esempio di una proprietà che contiene un riferimento ID. Quando viene applicato questo attributo, i progettisti possono fornire funzionalità aggiuntive durante la fase di progettazione, ad esempio gli ID elenco.
Costruttori
| Nome | Descrizione |
|---|---|
| IDReferencePropertyAttribute() |
Inizializza una nuova istanza della classe IDReferencePropertyAttribute. |
| IDReferencePropertyAttribute(Type) |
Inizializza una nuova istanza della IDReferencePropertyAttribute classe utilizzando il tipo specificato. |
Proprietà
| Nome | Descrizione |
|---|---|
| ReferencedControlType |
Ottiene il tipo dei controlli consentiti dalla proprietà a cui viene applicato l'attributo IDReferencePropertyAttribute . |
| TypeId |
Se implementato in una classe derivata, ottiene un identificatore univoco per questo Attribute. (Ereditato da Attribute) |
Metodi
| Nome | Descrizione |
|---|---|
| Equals(Object) |
Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato. |
| GetHashCode() |
Restituisce il codice hash per questa istanza. |
| GetType() |
Ottiene il Type dell'istanza corrente. (Ereditato da Object) |
| IsDefaultAttribute() |
Quando sottoposto a override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata. (Ereditato da Attribute) |
| Match(Object) |
Quando sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza è uguale a un oggetto specificato. (Ereditato da Attribute) |
| MemberwiseClone() |
Crea una copia superficiale del Objectcorrente. (Ereditato da Object) |
| ToString() |
Restituisce una stringa che rappresenta l'oggetto corrente. (Ereditato da Object) |
Implementazioni dell'interfaccia esplicita
| Nome | Descrizione |
|---|---|
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch. (Ereditato da Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera le informazioni sul tipo per un oggetto, che può essere utilizzato per ottenere le informazioni sul tipo per un'interfaccia. (Ereditato da Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1). (Ereditato da Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto . (Ereditato da Attribute) |