DataConnectionProperties.AddProperty 方法 (PropertyDescriptor, array<Attribute )

动态添加一个新属性。DataConnectionProperties 选件类的当前实例本身识别的属性集合。

命名空间:  Microsoft.VisualStudio.Data.Framework
程序集:  Microsoft.VisualStudio.Data.Framework(在 Microsoft.VisualStudio.Data.Framework.dll 中)

语法

声明
Protected Function AddProperty ( _
    descriptor As PropertyDescriptor, _
    ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
    PropertyDescriptor descriptor,
    params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
    PropertyDescriptor^ descriptor, 
    ... array<Attribute^>^ attributes
)
member AddProperty : 
        descriptor:PropertyDescriptor * 
        attributes:Attribute[] -> PropertyDescriptor 
protected function AddProperty(
    descriptor : PropertyDescriptor, 
    ... attributes : Attribute[]
) : PropertyDescriptor

参数

返回值

类型:System.ComponentModel.PropertyDescriptor
新添加的属性的类型描述符。

异常

异常 条件
ArgumentNullException

descriptor 参数为 nullnull 引用(在 Visual Basic 中为 Nothing)。

ArgumentException

所指定的属性已存在。

备注

输入属性说明符是一个专用连接属性说明符包装,因此,返回值实际上是通过的一个不同的 PropertyDescriptor 实例。

.NET Framework 安全性

请参见

参考

DataConnectionProperties 类

AddProperty 重载

Microsoft.VisualStudio.Data.Framework 命名空间

RemoveProperty