DataConnectionProperties.AddProperty Method (PropertyDescriptor, [])

Dynamically adds a new property to the collection of properties natively recognized by the current instance of the DataConnectionProperties class.

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

Syntax

'宣言
Protected Function AddProperty ( _
    descriptor As PropertyDescriptor, _
    ParamArray attributes As Attribute() _
) As PropertyDescriptor
'使用
Dim descriptor As PropertyDescriptor
Dim attributes As Attribute()
Dim returnValue As PropertyDescriptor

returnValue = Me.AddProperty(descriptor, _
    attributes)
protected PropertyDescriptor AddProperty(
    PropertyDescriptor descriptor,
    params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
    PropertyDescriptor^ descriptor, 
    ... array<Attribute^>^ attributes
)
protected function AddProperty(
    descriptor : PropertyDescriptor, 
    ... attributes : Attribute[]
) : PropertyDescriptor

Parameters

  • attributes
    Type: []

    A set of attributes to apply to the property.

Return Value

Type: System.ComponentModel.PropertyDescriptor

The descriptor of the newly added property.

Exceptions

Exception Condition
ArgumentNullException

The descriptor parameter is a null reference (Nothing in Visual Basic).

ArgumentException

The specified property already exists.

Remarks

The input property descriptor is wrapped by a specialized connection property descriptor, so the return value is actually a different PropertyDescriptor instance from the one passed in.

Permissions

See Also

Reference

DataConnectionProperties Class

DataConnectionProperties Members

AddProperty Overload

Microsoft.VisualStudio.Data.Framework Namespace

RemoveProperty