Metodo DataConnectionProperties.AddProperty (String, Type, array<Attribute[])
Aggiungere dinamicamente una nuova proprietà alla raccolta di proprietà a livello nativo riconosciute da questa istanza delle proprietà di connessione dati.
Spazio dei nomi: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Sintassi
'Dichiarazione
Protected Function AddProperty ( _
name As String, _
type As Type, _
ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
string name,
Type type,
params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
String^ name,
Type^ type,
... array<Attribute^>^ attributes
)
member AddProperty :
name:string *
type:Type *
attributes:Attribute[] -> PropertyDescriptor
protected function AddProperty(
name : String,
type : Type,
... attributes : Attribute[]
) : PropertyDescriptor
Parametri
name
Tipo: StringNome della proprietà.
type
Tipo: TypeIl tipo di dati della proprietà.
attributes
Tipo: array<Attribute[]Un set di attributi da associare alla proprietà.
Valore restituito
Tipo: PropertyDescriptor
Il descrittore di proprietà appena aggiunta.
Eccezioni
Eccezione | Condizione |
---|---|
ArgumentNullException | I parametri type e/o name null. |
InvalidOperationException | La proprietà specificata esiste già. |
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per altre informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
DataConnectionProperties Classe