Condividi tramite


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: String

    Nome della proprietà.

  • type
    Tipo: Type

    Il 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

Vedere anche

Riferimenti

DataConnectionProperties Classe

Overload AddProperty

Spazio dei nomi Microsoft.VisualStudio.Data

RemoveProperty