Dynamically adds a new property to the collection of properties natively recognized by this data connection properties instance.
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'宣言
Protected Function AddProperty ( _
name As String, _
type As Type, _
ParamArray attributes As Attribute() _
) As PropertyDescriptor
'使用
Dim name As String
Dim type As Type
Dim attributes As Attribute()
Dim returnValue As PropertyDescriptor
returnValue = Me.AddProperty(name, _
type, attributes)
protected PropertyDescriptor AddProperty(
string name,
Type type,
params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
String^ name,
Type^ type,
... array<Attribute^>^ attributes
)
protected function AddProperty(
name : String,
type : Type,
... attributes : Attribute[]
) : PropertyDescriptor
Parameters
name
Type: System.StringThe property name.
type
Type: System.TypeThe data type of the property.
attributes
Type: []A set of attributes to attach to the property.
Return Value
Type: System.ComponentModel.PropertyDescriptor
The descriptor of the newly added property.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | The name and/or type parameters are null. |
| InvalidOperationException | The specified property already exists. |
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
DataConnectionProperties Class
DataConnectionProperties Members