Freigeben über


DataConnectionProperties.AddProperty-Methode (String, Type, array<Attribute[])

Fügt dynamisch eine neue Eigenschaft der Auflistung von Eigenschaften hinzu, die direkt von dieser Datenverbindungseigenschaftinstanz erkannt werden.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
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

Parameter

  • name
    Typ: String

    Der Eigenschaftenname.

  • type
    Typ: Type

    Der Datentyp der Eigenschaft.

  • attributes
    Typ: array<Attribute[]

    Ein Satz von zur Eigenschaft angefügt werden Attribute.

Rückgabewert

Typ: PropertyDescriptor
Der Deskriptor der neu hinzugefügten Eigenschaft.

Ausnahmen

Ausnahme Bedingung
ArgumentNullException

Die name und/oder type-Parameter sind NULL.

InvalidOperationException

Die angegebene Eigenschaft ist bereits vorhanden.

.NET Framework-Sicherheit

Siehe auch

Referenz

DataConnectionProperties Klasse

AddProperty-Überladung

Microsoft.VisualStudio.Data-Namespace

RemoveProperty